Adjusted text unpack so that output is converted from tuple to string.
This commit is contained in:
parent
a4510e2d62
commit
3d348670fa
|
@ -5,7 +5,8 @@ def readUnpack(bytes, **options):
|
||||||
if options.get("type") == 't':
|
if options.get("type") == 't':
|
||||||
#print 'DEBUG: In t'
|
#print 'DEBUG: In t'
|
||||||
SOS = SOSfile.read(bytes)
|
SOS = SOSfile.read(bytes)
|
||||||
return unpack('%ss' % bytes, SOS)
|
text_unpacked = unpack('%ss' % bytes, SOS)
|
||||||
|
return ''.join(text_unpacked)
|
||||||
|
|
||||||
if options.get("type") == 'b':
|
if options.get("type") == 'b':
|
||||||
#print 'DEBUG: In b', bytes
|
#print 'DEBUG: In b', bytes
|
||||||
|
@ -23,7 +24,7 @@ print("\033c");
|
||||||
SOSfile = open('SOSCFFA.DRIVER', 'rb')
|
SOSfile = open('SOSCFFA.DRIVER', 'rb')
|
||||||
filetype = readUnpack(8, type = 't')
|
filetype = readUnpack(8, type = 't')
|
||||||
|
|
||||||
if 'SOS DRVR' in filetype:
|
if filetype == 'SOS DRVR':
|
||||||
print "This is a proper SOS file."
|
print "This is a proper SOS file."
|
||||||
print "Filetype is: %s." % (filetype)
|
print "Filetype is: %s." % (filetype)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue