Keep it simple ;)

Just define the extract commands as a list, then add the filePath and finally call it.
This commit is contained in:
Clinton Hall 2013-03-01 04:32:04 -08:00
parent 356b2059d9
commit 083d58a5d9

View file

@ -118,9 +118,8 @@ def extract(dirpath, file, outputDestination):
Logger.error("EXTRACTOR: Extraction failed for %s. Could not call command %s", filePath, run) Logger.error("EXTRACTOR: Extraction failed for %s. Could not call command %s", filePath, run)
else: else:
try: try:
x = len(cmd) cmd.append(filePath) # add filePath to final cmd arg.
cmd[x] = filePath # add filePath to final cmd arg res = call(cmd) # should extract files fine.
res = call(cmd) #
if res == 0: if res == 0:
Logger.info("EXTRACTOR: Extraction was successful for %s to %s", filePath, outputDestination) Logger.info("EXTRACTOR: Extraction was successful for %s to %s", filePath, outputDestination)
else: else: