added extractor progress bar and additional progress info

This commit is contained in:
Rob Weber
2015-06-26 15:32:22 -05:00
parent 032a772a81
commit 3e38f992b5
5 changed files with 112 additions and 56 deletions

View File

@@ -0,0 +1,33 @@
import xbmc
import utils as utils
class ZipExtractor:
def extract(self,zipFile,outLoc,progressBar):
utils.log("extracting zip archive")
result = True #result is true unless we fail
#update the progress bar
progressBar.updateProgress(0,utils.getString(30100))
#list the files
fileCount = float(len(zipFile.listFiles()))
currentFile = 0
try:
for aFile in zipFile.listFiles():
#update the progress bar
currentFile += 1
progressBar.updateProgress(int((currentFile/fileCount) * 100),utils.getString(30100))
#extract the file
zipFile.extract(aFile,outLoc)
except Exception,e:
print str(e)
utils.log("Error extracting file", xbmc.LOGDEBUG)
result = False
return result