mirror of
https://github.com/paulhagstrom/dsk2po.git
synced 2024-12-23 07:29:42 +00:00
replace extension instead of append
This commit is contained in:
parent
cd5c7cc37f
commit
813c023e77
@ -1,8 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# unscramble dsk into po
|
# unscramble dsk into po
|
||||||
# Paul Hagstrom, Dec 2015
|
# Paul Hagstrom, Dec 2015
|
||||||
import sys
|
import sys, getopt, re
|
||||||
import getopt
|
|
||||||
def main(argv=None):
|
def main(argv=None):
|
||||||
print("dsk2po - convert dsk files to po files")
|
print("dsk2po - convert dsk files to po files")
|
||||||
|
|
||||||
@ -23,7 +22,7 @@ def main(argv=None):
|
|||||||
for track in range(35):
|
for track in range(35):
|
||||||
trackbuffer = dskfile.read(4096)
|
trackbuffer = dskfile.read(4096)
|
||||||
potracks.append(dsk2po(trackbuffer))
|
potracks.append(dsk2po(trackbuffer))
|
||||||
pofilename = dskfilename + '.po'
|
pofilename = re.sub('\.dsk$', '', dskfilename, flags=re.IGNORECASE) + ".po"
|
||||||
print('Writing po image to {}'.format(pofilename))
|
print('Writing po image to {}'.format(pofilename))
|
||||||
with open(pofilename, mode="wb") as pofile:
|
with open(pofilename, mode="wb") as pofile:
|
||||||
for potrack in potracks:
|
for potrack in potracks:
|
||||||
|
Loading…
Reference in New Issue
Block a user