try except unzipper -> workaround
This commit is contained in:
+1
-1
@@ -115,7 +115,7 @@ def tree_hash(path):
|
|||||||
contents = os.listdir(path)
|
contents = os.listdir(path)
|
||||||
tsize = 0
|
tsize = 0
|
||||||
|
|
||||||
to_skip = ('.', '..', '.git', '.DS_Store', '.idea', '.directory')
|
to_skip = ('.', '..', '.git', '.DS_Store', '.idea', '.directory', 'custom_code.json', 'last_commit.txt')
|
||||||
to_skip_ext = ('pyo', 'pyc')
|
to_skip_ext = ('pyo', 'pyc')
|
||||||
pass1 = []
|
pass1 = []
|
||||||
for entry in contents:
|
for entry in contents:
|
||||||
|
|||||||
@@ -222,11 +222,14 @@ def updateFromZip():
|
|||||||
destpathname = xbmc.translatePath("special://home/addons/")
|
destpathname = xbmc.translatePath("special://home/addons/")
|
||||||
logger.info("destpathname=%s" % destpathname)
|
logger.info("destpathname=%s" % destpathname)
|
||||||
|
|
||||||
# fix per android -> badZip file
|
try:
|
||||||
hash = fixZipGetHash(localfilename)
|
hash = fixZipGetHash(localfilename)
|
||||||
|
unzipper = ziptools()
|
||||||
unzipper = ziptools()
|
unzipper.extract(localfilename, destpathname)
|
||||||
unzipper.extract(localfilename, destpathname)
|
except Exception as e:
|
||||||
|
logger.info('Non sono riuscito ad estrarre il file zip')
|
||||||
|
logger.info(e)
|
||||||
|
return False
|
||||||
|
|
||||||
# puliamo tutto
|
# puliamo tutto
|
||||||
shutil.rmtree(addonDir)
|
shutil.rmtree(addonDir)
|
||||||
|
|||||||
Reference in New Issue
Block a user