mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2024-11-29 11:51:14 +00:00
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:
parent
1a4153c85f
commit
5d354d0b11
@ -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))
|
||||
|
1
atrcopy/templates/dos2dd.atr.inf
Normal file
1
atrcopy/templates/dos2dd.atr.inf
Normal 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"}
|
@ -1 +0,0 @@
|
||||
Atari 8-bit DOS 2 double density (180K), empty VTOC
|
0
atrcopy/templates/dos2ed+2.5 → atrcopy/templates/dos2ed+2.5.atr
Executable file → Normal file
0
atrcopy/templates/dos2ed+2.5 → atrcopy/templates/dos2ed+2.5.atr
Executable file → Normal file
1
atrcopy/templates/dos2ed+2.5.atr.inf
Normal file
1
atrcopy/templates/dos2ed+2.5.atr.inf
Normal 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"}
|
@ -1 +0,0 @@
|
||||
Atari 8-bit DOS 2 enhanced density (130K) DOS 2.5 system disk
|
1
atrcopy/templates/dos2ed.atr.inf
Normal file
1
atrcopy/templates/dos2ed.atr.inf
Normal 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"}
|
@ -1 +0,0 @@
|
||||
Atari 8-bit DOS 2 enhanced density (130K), empty VTOC
|
1
atrcopy/templates/dos2sd+2.0s.atr.inf
Normal file
1
atrcopy/templates/dos2sd+2.0s.atr.inf
Normal 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"}
|
@ -1 +0,0 @@
|
||||
Atari 8-bit DOS 2 single density (90K) DOS 2.0S system disk
|
1
atrcopy/templates/dos2sd.atr.inf
Normal file
1
atrcopy/templates/dos2sd.atr.inf
Normal 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"}
|
@ -1 +0,0 @@
|
||||
Atari 8-bit DOS 2 single density (90K), empty VTOC
|
1
atrcopy/templates/dos33.dsk.inf
Normal file
1
atrcopy/templates/dos33.dsk.inf
Normal 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"}
|
@ -1 +0,0 @@
|
||||
Apple ][ DOS 3.3 (140K) standard RWTS, empty VTOC
|
1
atrcopy/templates/dos33autobrun.dsk.inf
Normal file
1
atrcopy/templates/dos33autobrun.dsk.inf
Normal 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"}
|
@ -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
|
Loading…
Reference in New Issue
Block a user