From a5be594abe015ec62a1ad77672dc653558eef08d Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Sat, 23 Mar 2013 16:25:53 -0700 Subject: [PATCH] check is chp.exe exists. fixes #99 --- extractor/extractor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extractor/extractor.py b/extractor/extractor.py index 73e700a8..8461bedf 100644 --- a/extractor/extractor.py +++ b/extractor/extractor.py @@ -54,7 +54,10 @@ def extract(filePath, outputDestination): Logger.error("EXTRACTOR: Could not find 7-zip, Exiting") sys.exit(-1) else: - cmd_7zip = [chplocation, sevenzipLocation, "x", "-y"] + if not os.path.exists(chplocation): + cmd_7zip = [sevenzipLocation, "x", "-y"] + else: + cmd_7zip = [chplocation, sevenzipLocation, "x", "-y"] ext_7zip = [".rar",".zip",".tar.gz","tgz",".tar.bz2",".tbz",".tar.lzma",".tlz",".7z",".xz"] EXTRACT_COMMANDS = dict.fromkeys(ext_7zip, cmd_7zip) # Using unix