From 2a77abc91884e9a9f7bdfab1e6fc55aca3801678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Thu, 30 Jan 2020 10:14:51 -0500 Subject: [PATCH] WIP --- bazarr.py | 31 ++++++++++--------------------- views/menu.html | 34 +--------------------------------- 2 files changed, 11 insertions(+), 54 deletions(-) diff --git a/bazarr.py b/bazarr.py index ae5d88f13..53e36b002 100644 --- a/bazarr.py +++ b/bazarr.py @@ -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 diff --git a/views/menu.html b/views/menu.html index 1cde53462..2acc03015 100644 --- a/views/menu.html +++ b/views/menu.html @@ -230,39 +230,7 @@ - {% endif %} - - % from six import PY2 - % import datetime - % if PY2: -
-
-
- -
-
Python deprecation warning
- 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. -
- % if os.name == 'posix': -
If you are running under Docker, don't worry, we'll take care of this for you. - Just pull the new image. -
- % end - % if os.name == 'nt': -
If you have installed using the Windows Installer, we'll provide a new - installer soon. -
- % end -
If you are running from source, it's up to you to install Python 3 and use it - to run Bazarr. -
-
-
-
-
-
- % end + {% end %}