|
|
@ -4,33 +4,25 @@ from __future__ import absolute_import
|
|
|
|
from __future__ import print_function
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
|
|
|
|
import bazarr.libs
|
|
|
|
import bazarr.libs
|
|
|
|
from six import PY3
|
|
|
|
|
|
|
|
import subprocess as sp
|
|
|
|
import subprocess as sp
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import platform
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from bazarr.get_args import args
|
|
|
|
from bazarr.get_args import args
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def check_python_version():
|
|
|
|
def check_python_version():
|
|
|
|
python_version = platform.python_version_tuple()
|
|
|
|
python_version = (sys.version_info.major, sys.version_info.minor, sys.version_info.micro)
|
|
|
|
minimum_python_version_tuple = (2, 7, 13)
|
|
|
|
python_version_str = '.'.join(map(str, python_version))
|
|
|
|
minimum_python3_version_tuple = (3, 6, 0)
|
|
|
|
minimum_python3_version = (3, 6, 0)
|
|
|
|
minimum_python_version = ".".join(str(i) for i in minimum_python_version_tuple)
|
|
|
|
minimum_python3_version_str = '.'.join(map(str, minimum_python3_version))
|
|
|
|
minimum_python3_version = ".".join(str(i) for i in minimum_python3_version_tuple)
|
|
|
|
|
|
|
|
|
|
|
|
if python_version >= minimum_python3_version:
|
|
|
|
if int(python_version[0]) == minimum_python3_version_tuple[0]:
|
|
|
|
|
|
|
|
if int(python_version[1]) >= minimum_python3_version_tuple[1]:
|
|
|
|
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print("Python " + minimum_python3_version + " or greater required. Current version is " + platform.python_version() + ". Please upgrade Python.")
|
|
|
|
print("Python " + minimum_python3_version_str + " or greater required. Current version is " +
|
|
|
|
os._exit(0)
|
|
|
|
python_version_str + ". Please upgrade Python.")
|
|
|
|
|
|
|
|
|
|
|
|
elif int(python_version[1]) < minimum_python_version_tuple[1] or int(re.search(r'\d+', python_version[2]).group()) < minimum_python_version_tuple[2]:
|
|
|
|
|
|
|
|
print("Python " + minimum_python_version + " or greater required. Current version is " + platform.python_version() + ". Please upgrade Python.")
|
|
|
|
|
|
|
|
os._exit(0)
|
|
|
|
os._exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -49,10 +41,7 @@ def start_bazarr():
|
|
|
|
line = ep.stdout.readline()
|
|
|
|
line = ep.stdout.readline()
|
|
|
|
if line == '' or not line:
|
|
|
|
if line == '' or not line:
|
|
|
|
break
|
|
|
|
break
|
|
|
|
if PY3:
|
|
|
|
|
|
|
|
sys.stdout.buffer.write(line)
|
|
|
|
sys.stdout.buffer.write(line)
|
|
|
|
else:
|
|
|
|
|
|
|
|
sys.stdout.write(line)
|
|
|
|
|
|
|
|
sys.stdout.flush()
|
|
|
|
sys.stdout.flush()
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|