Browse Source

Py3: Basic running of external programs and fixing startup on Linux

pull/1161/head
Safihre 8 years ago
parent
commit
056f82a2ae
  1. 3
      requirements.txt
  2. 2
      sabnzbd/api.py
  3. 6
      sabnzbd/newsunpack.py

3
requirements.txt

@ -4,4 +4,5 @@ cryptography
feedparser feedparser
configobj configobj
cherrypy cherrypy
gntp gntp
git+git://github.com/sabnzbd/sabyenc@sabyenc3#egg=sabyenc

2
sabnzbd/api.py

@ -1947,7 +1947,7 @@ def list_cats(default=True):
def remove_callable(dic): def remove_callable(dic):
""" Remove all callable items from dictionary """ """ Remove all callable items from dictionary """
for key, value in dic.items(): for key, value in list(dic.items()):
if callable(value): if callable(value):
del dic[key] del dic[key]
return dic return dic

6
sabnzbd/newsunpack.py

@ -30,7 +30,7 @@ import shutil
from subprocess import Popen from subprocess import Popen
import sabnzbd import sabnzbd
from sabnzbd.encoding import TRANS, UNTRANS, unicoder, platform_encode, deunicode from sabnzbd.encoding import ubtou, TRANS, UNTRANS, unicoder, platform_encode, deunicode
import sabnzbd.utils.rarfile as rarfile import sabnzbd.utils.rarfile as rarfile
from sabnzbd.misc import format_time_string, find_on_path, make_script_path, int_conv, \ from sabnzbd.misc import format_time_string, find_on_path, make_script_path, int_conv, \
real_path, globber, globber_full, get_all_passwords, renamer, clip_path, \ real_path, globber, globber_full, get_all_passwords, renamer, clip_path, \
@ -2158,7 +2158,7 @@ def unrar_check(rar):
version = run_simple(rar) version = run_simple(rar)
except: except:
return version, original return version, original
original = b"Alexander Roshal" in version original = "Alexander Roshal" in version
m = re.search(r"RAR\s(\d+)\.(\d+)", version) m = re.search(r"RAR\s(\d+)\.(\d+)", version)
if m: if m:
version = int(m.group(1)) * 100 + int(m.group(2)) version = int(m.group(1)) * 100 + int(m.group(2))
@ -2377,6 +2377,6 @@ class SevenZip(object):
def run_simple(cmd): def run_simple(cmd):
""" Run simple external command and return output """ """ Run simple external command and return output """
p = Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p = Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
txt = p.stdout.read() txt = ubtou(p.stdout.read())
p.wait() p.wait()
return txt return txt

Loading…
Cancel
Save