pep8 comments

This commit is contained in:
Rob Weber
2019-11-25 15:19:57 -06:00
parent bbbfc3dd84
commit f7665c8ddd
11 changed files with 234 additions and 235 deletions

View File

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