Changed templates so they can be imported into omnivore

* template images now have file extension
* .inf files are now in json format, including some omnivore metadata
This commit is contained in:
Rob McMullen 2017-05-25 06:50:27 -07:00
parent 1a4153c85f
commit 5d354d0b11
22 changed files with 15 additions and 11 deletions

View File

@ -4,6 +4,7 @@ from builtins import str
import os
import sys
import zlib
import json
import logging
log = logging.getLogger(__name__)
@ -300,7 +301,9 @@ def get_template_info():
continue
try:
with open(name + ".inf", "r") as fh:
description = fh.read().strip()
s = fh.read()
j = json.loads(s)
description = j["description"]
except IOError:
description = ""
d = textwrap.wrap(description, 80 - 1 - 14 - 2 - 2)
@ -318,9 +321,10 @@ def get_template_data(template):
raise InvalidDiskImage("Template disk image %s not found" % template)
try:
with open(path + ".inf", "r") as fh:
inf = fh.read().strip()
s = fh.read()
inf = json.loads(s)
except IOError:
inf = ""
inf = {"description": ""}
return data, inf
@ -328,7 +332,7 @@ def create_image(template, name):
import textwrap
data, inf = get_template_data(template)
print("using %s template:\n %s" % (template, "\n ".join(textwrap.wrap(inf, 77))))
print("using %s template:\n %s" % (template, "\n ".join(textwrap.wrap(inf["description"], 77))))
if not options.dry_run:
if os.path.exists(name) and not options.force:
print("skipping %s, use -f to overwrite" % (name))

View File

@ -0,0 +1 @@
{"task": "hex_edit", "description": "Atari 8-bit DOS 2 double density (180K), empty VTOC", "label": "Atari DOS 2 DD (180K) blank image", "ext": "atr"}

View File

@ -1 +0,0 @@
Atari 8-bit DOS 2 double density (180K), empty VTOC

View File

View File

@ -0,0 +1 @@
{"task": "hex_edit", "description": "Atari 8-bit DOS 2 enhanced density (130K) DOS 2.5 system disk", "label": "Atari DOS 2.5 ED (130K) system disk", "ext": "atr"}

View File

@ -1 +0,0 @@
Atari 8-bit DOS 2 enhanced density (130K) DOS 2.5 system disk

View File

@ -0,0 +1 @@
{"task": "hex_edit", "description": "Atari 8-bit DOS 2 enhanced density (130K), empty VTOC", "label": "Atari DOS 2 ED (130K) blank image", "ext": "atr"}

View File

@ -1 +0,0 @@
Atari 8-bit DOS 2 enhanced density (130K), empty VTOC

View File

@ -0,0 +1 @@
{"task": "hex_edit", "description": "Atari 8-bit DOS 2 single density (90K) DOS 2.0S system disk", "label": "Atari DOS 2.0S SD (90K) system disk", "ext": "atr"}

View File

@ -1 +0,0 @@
Atari 8-bit DOS 2 single density (90K) DOS 2.0S system disk

View File

@ -0,0 +1 @@
{"task": "hex_edit", "description": "Atari 8-bit DOS 2 single density (90K), empty VTOC", "label": "Atari DOS 2 SD (90K) blank image", "ext": "atr"}

View File

@ -1 +0,0 @@
Atari 8-bit DOS 2 single density (90K), empty VTOC

View File

@ -0,0 +1 @@
{"task": "hex_edit", "description": "Apple ][ DOS 3.3 (140K) standard RWTS, empty VTOC", "label": "Apple DOS 3.3 (140K) blank image", "ext": "dsk"}

View File

@ -1 +0,0 @@
Apple ][ DOS 3.3 (140K) standard RWTS, empty VTOC

View File

@ -0,0 +1 @@
{"task": "hex_edit", "description": "Apple ][ DOS 3.3 (140K) disk image for binary program development: HELLO sets fullscreen HGR and calls BRUN on user-supplied AUTOBRUN binary file", "label": "Apple DOS 3.3 (140K) AUTOBRUN image", "ext": "dsk"}

View File

@ -1 +0,0 @@
Apple ][ DOS 3.3 (140K) disk image for binary program development: HELLO sets fullscreen HGR and calls BRUN on user-supplied AUTOBRUN binary file