mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-02-08 00:30:27 +00:00
Fixed file extraction using old variable name
This commit is contained in:
parent
8526e111f1
commit
8555ead870
@ -734,7 +734,7 @@ def to_numpy(value):
|
|||||||
return np.fromstring(value, dtype=np.uint8)
|
return np.fromstring(value, dtype=np.uint8)
|
||||||
raise TypeError("Can't convert to numpy data")
|
raise TypeError("Can't convert to numpy data")
|
||||||
|
|
||||||
def process(dirent, options):
|
def process(image, dirent, options):
|
||||||
skip = False
|
skip = False
|
||||||
action = "copying to"
|
action = "copying to"
|
||||||
filename = dirent.get_filename()
|
filename = dirent.get_filename()
|
||||||
@ -755,7 +755,7 @@ def process(dirent, options):
|
|||||||
if options.extract:
|
if options.extract:
|
||||||
print "%s: %s %s" % (dirent, action, outfilename)
|
print "%s: %s %s" % (dirent, action, outfilename)
|
||||||
if not skip:
|
if not skip:
|
||||||
bytes = atr.get_file(dirent)
|
bytes = image.get_file(dirent)
|
||||||
with open(outfilename, "wb") as fh:
|
with open(outfilename, "wb") as fh:
|
||||||
fh.write(bytes)
|
fh.write(bytes)
|
||||||
else:
|
else:
|
||||||
@ -818,7 +818,7 @@ if __name__ == "__main__":
|
|||||||
elif image.files or options.force:
|
elif image.files or options.force:
|
||||||
for dirent in image.files:
|
for dirent in image.files:
|
||||||
try:
|
try:
|
||||||
process(dirent, options)
|
process(image, dirent, options)
|
||||||
except FileNumberMismatchError164:
|
except FileNumberMismatchError164:
|
||||||
print "Error 164: %s" % str(dirent)
|
print "Error 164: %s" % str(dirent)
|
||||||
except ByteNotInFile166:
|
except ByteNotInFile166:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user