diff --git a/CHANGES.md b/CHANGES.md index f973e88..ac7cfe8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,11 @@ * Update urllib3 release 1.24.3 (324e47a) to 1.25.2 (49eea80) * Update win_inet_pton 1.0.1 (934a852) to 1.1.0 (57e3558) * Update xmltodict library 0.11.0 (79ac9a4) to 0.12.0 (f3ab7e1) +* Change sickgear.py can now be run as start up instead of SickBeard.py +* Change refactor startup functions to prevent possible latency issues with systemd +* Add startup loading page +* Change restart to use loading page +* Add upgrade messages for sickbeard, cache, and failed db upgrade processes to loading page [develop changelog] diff --git a/SickBeard.py b/SickBeard.py index 9ee64f3..31cfd1e 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -1,6 +1,4 @@ #!/usr/bin/env python2 -# Author: Nic Wolfe -# URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # @@ -17,644 +15,16 @@ # You should have received a copy of the GNU General Public License # along with SickGear. If not, see . -# Check needed software dependencies to nudge users to fix their setup from __future__ import print_function -from __future__ import with_statement - -import datetime -import errno -import getopt -import locale -import os -import signal -import sys -import shutil -import subprocess -import time -import threading -import warnings - -warnings.filterwarnings('ignore', module=r'.*fuzzywuzzy.*') -warnings.filterwarnings('ignore', module=r'.*Cheetah.*') -warnings.filterwarnings('ignore', module=r'.*connectionpool.*', message='.*certificate verification.*') -warnings.filterwarnings('ignore', module=r'.*ssl_.*', message='.*SSLContext object.*') -warnings.filterwarnings('ignore', module=r'.*zoneinfo.*', message='.*file or directory.*') - -if not (2, 7, 9) <= sys.version_info < (3, 0): - print('Python %s.%s.%s detected.' % sys.version_info[:3]) - print('Sorry, SickGear requires Python 2.7.9 or higher. Python 3 is not supported.') - sys.exit(1) - -try: - import _cleaner -except (StandardError, Exception): - pass - -try: - import Cheetah - - if Cheetah.Version[0] < '2': - raise ValueError -except ValueError: - print('Sorry, requires Python module Cheetah 2.1.0 or newer.') - sys.exit(1) -except (StandardError, Exception): - print('The Python module Cheetah is required') - sys.exit(1) - -sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))) -from lib.six import moves - -# We only need this for compiling an EXE and I will just always do that on 2.6+ -if sys.hexversion >= 0x020600F0: - from multiprocessing import freeze_support # @UnresolvedImport - -import sickbeard -from sickbeard import db, logger, network_timezones, failed_history, name_cache -from sickbeard.tv import TVShow -from sickbeard.webserveInit import WebServer -from sickbeard.databases.mainDB import MIN_DB_VERSION, MAX_DB_VERSION -from sickbeard.event_queue import Events -from sickbeard.exceptions import ex -from lib.configobj import ConfigObj - -throwaway = datetime.datetime.strptime('20110101', '%Y%m%d') -rollback_loaded = None - -signal.signal(signal.SIGINT, sickbeard.sig_handler) -signal.signal(signal.SIGTERM, sickbeard.sig_handler) -if 'win32' == sys.platform: - signal.signal(signal.SIGBREAK, sickbeard.sig_handler) - - -class SickGear(object): - def __init__(self): - # system event callback for shutdown/restart - sickbeard.events = Events(self.shutdown) - - # daemon constants - self.run_as_daemon = False - self.create_pid = False - self.pid_file = '' - - self.run_as_systemd = False - self.console_logging = False - - # webserver constants - self.webserver = None - self.force_update = False - self.forced_port = None - self.no_launch = False - - self.web_options = None - self.webhost = None - self.start_port = None - self.log_dir = None - - @staticmethod - def help_message(): - """ - print help message for commandline options - """ - help_msg = [''] - help_msg += ['Usage: %s