Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ZipManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def getPythonModelFileName(fn:str)->str:

#global Cmtp

#assert(zipfile.is_zipfile(fn))
assert(zipfile.is_zipfile(fn))

zf = zipfile.ZipFile(fn,'r')

Expand Down Expand Up @@ -140,15 +140,15 @@ def Update(self, replace_files:[str]=[])->None:
if zipfile.is_zipfile(dir_name):
z = zipfile.ZipFile(dir_name, 'r')
data = z.read(base_name)
z.close()

### if zip file contain image file we can not encode it.
try:
zout.writestr(base_name, data)
except UnicodeDecodeError as info:
zout.writestr(base_name, data)
else:
sys.stdout.write("%s not rewrite\n"%(fn))

z.close()

#sys.stdout.write("update %s from compressed %s\n"%(base_name, fn))
elif os.path.exists(fn):
Expand Down