Added unrar support to extract.py

master
lanxu 2017-03-19 20:10:59 +02:00
parent 1e56ed5322
commit b83b721bdf
1 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,8 @@ def main(argv):
extractTools = [
{ "extension": "\.tar\.gz$", "command": "tar", "params": "-xf", "oparams": "-C" },
{ "extension": "\.tar\.xz$", "command": "tar", "params": "-xf", "oparams": "-C" },
{ "extension": "\.zip$", "command": "unzip", "params": "", "oparams": "-d" }
{ "extension": "\.zip$", "command": "unzip", "params": "", "oparams": "-d" },
{ "extension": "\.rar$", "command": "unrar", "params": "x", "oparams": "" },
]
if os.path.isfile(argv[0]) == False:
@ -91,7 +92,8 @@ def main(argv):
if not os.path.exists(output_path):
os.makedirs(output_path)
command.append(tool['oparams'])
if tool["oparams"] is not "":
command.append(tool['oparams'])
command.append(output_path)
try: