Commit 5513e22e authored by wanli's avatar wanli

update

parent 693a80b7
...@@ -11,7 +11,6 @@ import zlib ...@@ -11,7 +11,6 @@ import zlib
import pprint import pprint
import hashlib import hashlib
def str_to_hex(s): def str_to_hex(s):
return ' '.join([hex(ord(c)).replace('0x', '') for c in s]) return ' '.join([hex(ord(c)).replace('0x', '') for c in s])
...@@ -76,7 +75,6 @@ class EpkApp(object): ...@@ -76,7 +75,6 @@ class EpkApp(object):
} }
if self._infoPath == os.sep.join([path, fname]): if self._infoPath == os.sep.join([path, fname]):
print(finfo)
files.insert(0, finfo) files.insert(0, finfo)
else: else:
files.append(finfo) files.append(finfo)
...@@ -134,15 +132,10 @@ class EpkApp(object): ...@@ -134,15 +132,10 @@ class EpkApp(object):
with open(fpath, "rb") as fc: with open(fpath, "rb") as fc:
fileContentBytes = fc.read() fileContentBytes = fc.read()
print(info["name"])
print(len(fileContentBytes))
fileBytes += struct.pack("<L", len(fileContentBytes)) fileBytes += struct.pack("<L", len(fileContentBytes))
fileCompressBytes = zlib.compress(fileContentBytes, level) fileCompressBytes = zlib.compress(fileContentBytes, level)
print(len(fileCompressBytes))
fileBytes += struct.pack("<L", len(fileCompressBytes)) fileBytes += struct.pack("<L", len(fileCompressBytes))
fileBytes += fileCompressBytes fileBytes += fileCompressBytes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment