use common create_destination

instead of duplicate code in both copylink and extractor
This commit is contained in:
Joel Kåberg 2013-03-01 11:10:10 +01:00
parent f41b576967
commit 9c34ac2a35
2 changed files with 13 additions and 17 deletions

View file

@ -100,13 +100,8 @@ def extract(dirpath, file, outputDestination):
return False
# Create outputDestination folder
if not os.path.exists(outputDestination):
try:
Logger.debug("EXTRACTOR: Creating destination folder: %s", outputDestination)
os.makedirs(outputDestination)
except Exception, e:
Logger.error("EXTRACTOR: Not possible to create destination folder: %s", e)
return False
create_destination(outputDestination)
Logger.info("Extracting %s to %s", filePath, outputDestination)
Logger.debug("Extracting %s %s %s %s", cmd[0], cmd[1], filePath, outputDestination)
pwd = os.getcwd() # Get our Present Working Directory