pull/884/head
Louis Vézina 5 years ago
parent 83c95cc77d
commit 2a77abc918

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

@ -230,39 +230,7 @@
</div>
</div>
</div>
{% endif %}
% from six import PY2
% import datetime
% if PY2:
<div class='ui left aligned grid'>
<div class='fluid column'>
<div class="ui yellow icon message">
<i class="python icon"></i>
<div class="content">
<div class="header">Python deprecation warning</div>
Bazarr is now compatible with Python 3.6 and newer. You should upgrade Python as we'll drop support
for Python 2.7.x by the end of 2019.
<div class="ui bulleted list">
% if os.name == 'posix':
<div class="item">If you are running under Docker, don't worry, we'll take care of this for you.
Just pull the new image.
</div>
% end
% if os.name == 'nt':
<div class="item">If you have installed using the Windows Installer, we'll provide a new
installer soon.
</div>
% end
<div class="item">If you are running from source, it's up to you to install Python 3 and use it
to run Bazarr.
</div>
</div>
</div>
</div>
</div>
</div>
% end
{% end %}
</div>
</body>
</html>

Loading…
Cancel
Save