From 9b143cd6f2eb2edc14f32149ed9e4532c3ecd7c6 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Sat, 1 Nov 2014 08:30:49 +1030 Subject: [PATCH] add 7za as alias for 7z and 7zr. --- nzbtomedia/__init__.py | 4 ++++ nzbtomedia/extractor/extractor.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/nzbtomedia/__init__.py b/nzbtomedia/__init__.py index 5bea29ad..ad91a637 100644 --- a/nzbtomedia/__init__.py +++ b/nzbtomedia/__init__.py @@ -630,6 +630,10 @@ def initialize(section=None): try: SEVENZIP = subprocess.Popen(['which', '7zr'], stdout=subprocess.PIPE).communicate()[0].strip() except: pass + if not SEVENZIP: + try: + SEVENZIP = subprocess.Popen(['which', '7za'], stdout=subprocess.PIPE).communicate()[0].strip() + except: pass if not SEVENZIP: SEVENZIP = None logger.warning("Failed to locate 7zip. Transcosing of disk images and extraction of .7z files will not be possible!") diff --git a/nzbtomedia/extractor/extractor.py b/nzbtomedia/extractor/extractor.py index 22ca581e..0632e9f4 100644 --- a/nzbtomedia/extractor/extractor.py +++ b/nzbtomedia/extractor/extractor.py @@ -47,6 +47,8 @@ def extract(filePath, outputDestination): if call(['which', cmd], stdout=devnull, stderr=devnull): #note, returns 0 if exists, or 1 if doesn't exist. if cmd == "7zr" and not call(["which", "7z"]): # we do have "7z" command EXTRACT_COMMANDS[".7z"] = ["7z", "x"] + elif cmd == "7zr" and not call(["which", "7za"]): # we do have "7za" command + EXTRACT_COMMANDS[".7z"] = ["7za", "x"] else: for k, v in EXTRACT_COMMANDS.items(): if cmd in v[0]: