mirror of
https://github.com/elliotnunn/macresources.git
synced 2024-12-11 11:49:24 +00:00
Stop polluting stdout.
This commit is contained in:
parent
08b64758d4
commit
b7739a449b
@ -100,9 +100,9 @@ def GreggDecompress(src, dst, unpackSize, pos=0):
|
||||
|
||||
hasDynamicTab = comprFlags & 1
|
||||
isBitmapped = comprFlags & 2
|
||||
print("tabSize: %d" % tabSize)
|
||||
print("comprFlags: 0x%X, dynamic table: %s, bitmap data: %s" % (comprFlags,
|
||||
"yes" if hasDynamicTab else "no", "yes" if isBitmapped else "no"))
|
||||
# print("tabSize: %d" % tabSize)
|
||||
# print("comprFlags: 0x%X, dynamic table: %s, bitmap data: %s" % (comprFlags,
|
||||
# "yes" if hasDynamicTab else "no", "yes" if isBitmapped else "no"))
|
||||
|
||||
if hasDynamicTab:
|
||||
nEntries = tabSize + 1
|
||||
@ -223,4 +223,4 @@ def GreggCompress(src, dst, customTab='auto', isBitmapped='auto'):
|
||||
if len(src) & 1: # copy over last byte in the case of odd length
|
||||
dst.append(src[-1])
|
||||
else:
|
||||
print("Non-bitmapped compression not yet implemented")
|
||||
raise ValueError("Non-bitmapped compression not yet implemented")
|
||||
|
@ -10,20 +10,19 @@ from .GreggBits import GreggDecompress, GreggCompress
|
||||
def GetEncoding(dat):
|
||||
sig, hdrlen, vers, attrs, biglen = struct.unpack_from(">IHBBI", dat)
|
||||
if sig != 0xA89F6572:
|
||||
print("Invalid extended resource header sig: 0x%X" % sig)
|
||||
# print("Invalid extended resource header sig: 0x%X" % sig)
|
||||
return 'UnknownCompression'
|
||||
if vers not in (8, 9):
|
||||
print("Unknown ext res header format: %d" % vers)
|
||||
# print("Unknown ext res header format: %d" % vers)
|
||||
return 'UnknownCompression'
|
||||
if attrs & 1 == 0:
|
||||
print("extAttributes,bit0 isn't set. Treat this res as uncompressed.")
|
||||
# print("extAttributes,bit0 isn't set. Treat this res as uncompressed.")
|
||||
return 'UnknownCompression'
|
||||
|
||||
print("Uncompressed length: %d" % biglen)
|
||||
# print("Uncompressed length: %d" % biglen)
|
||||
|
||||
if vers == 8:
|
||||
print('Donn unimplemented!'); return 'UnknownCompression'
|
||||
return 'DonnBits'
|
||||
return 'UnknownCompression' # return 'DonnBits'
|
||||
elif vers == 9:
|
||||
if dat[12:14] == b'\x00\x02':
|
||||
return 'GreggyBits'
|
||||
|
Loading…
Reference in New Issue
Block a user