mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Python 2 support dropped - all classes are new style classes in Python 3
This commit is contained in:
parent
8b00d6fba4
commit
b710c43df1
8 changed files with 14 additions and 14 deletions
|
@ -30,7 +30,7 @@ FOLDER_STRUCTURE = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class WorkingDirectory(object):
|
class WorkingDirectory:
|
||||||
"""Context manager for changing current working directory."""
|
"""Context manager for changing current working directory."""
|
||||||
|
|
||||||
def __init__(self, new, original=None):
|
def __init__(self, new, original=None):
|
||||||
|
|
|
@ -10,7 +10,7 @@ import requests
|
||||||
from core import logger
|
from core import logger
|
||||||
|
|
||||||
|
|
||||||
class ProcessResult(object):
|
class ProcessResult:
|
||||||
def __init__(self, message, status_code):
|
def __init__(self, message, status_code):
|
||||||
self.message = message
|
self.message = message
|
||||||
self.status_code = status_code
|
self.status_code = status_code
|
||||||
|
|
|
@ -26,7 +26,7 @@ import six
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
|
|
||||||
|
|
||||||
class InitSickBeard(object):
|
class InitSickBeard:
|
||||||
"""Sickbeard init class.
|
"""Sickbeard init class.
|
||||||
|
|
||||||
Used to determin which sickbeard fork object to initialize.
|
Used to determin which sickbeard fork object to initialize.
|
||||||
|
@ -316,7 +316,7 @@ class InitSickBeard(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class SickBeard(object):
|
class SickBeard:
|
||||||
"""Sickbeard base class."""
|
"""Sickbeard base class."""
|
||||||
|
|
||||||
def __init__(self, sb_init):
|
def __init__(self, sb_init):
|
||||||
|
|
|
@ -10,7 +10,7 @@ from __future__ import (
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
|
||||||
class GitHub(object):
|
class GitHub:
|
||||||
"""Simple api wrapper for the Github API v3."""
|
"""Simple api wrapper for the Github API v3."""
|
||||||
|
|
||||||
def __init__(self, github_repo_user, github_repo, branch='master'):
|
def __init__(self, github_repo_user, github_repo, branch='master'):
|
||||||
|
|
|
@ -36,7 +36,7 @@ reverseNames = {u'ERROR': ERROR,
|
||||||
u'DB': DB}
|
u'DB': DB}
|
||||||
|
|
||||||
|
|
||||||
class NTMRotatingLogHandler(object):
|
class NTMRotatingLogHandler:
|
||||||
def __init__(self, log_file, num_files, num_bytes):
|
def __init__(self, log_file, num_files, num_bytes):
|
||||||
self.num_files = num_files
|
self.num_files = num_files
|
||||||
self.num_bytes = num_bytes
|
self.num_bytes = num_bytes
|
||||||
|
@ -240,7 +240,7 @@ class NTMRotatingLogHandler(object):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
class DispatchingFormatter(object):
|
class DispatchingFormatter:
|
||||||
def __init__(self, formatters, default_formatter):
|
def __init__(self, formatters, default_formatter):
|
||||||
self._formatters = formatters
|
self._formatters = formatters
|
||||||
self._default_formatter = default_formatter
|
self._default_formatter = default_formatter
|
||||||
|
|
|
@ -58,7 +58,7 @@ def db_filename(filename='nzbtomedia.db', suffix=None):
|
||||||
return core.os.path.join(core.APP_ROOT, filename)
|
return core.os.path.join(core.APP_ROOT, filename)
|
||||||
|
|
||||||
|
|
||||||
class DBConnection(object):
|
class DBConnection:
|
||||||
def __init__(self, filename='nzbtomedia.db', suffix=None, row_type=None):
|
def __init__(self, filename='nzbtomedia.db', suffix=None, row_type=None):
|
||||||
|
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
|
@ -242,7 +242,7 @@ def sanity_check_database(connection, sanity_check):
|
||||||
sanity_check(connection).check()
|
sanity_check(connection).check()
|
||||||
|
|
||||||
|
|
||||||
class DBSanityCheck(object):
|
class DBSanityCheck:
|
||||||
def __init__(self, connection):
|
def __init__(self, connection):
|
||||||
self.connection = connection
|
self.connection = connection
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ def _process_upgrade(connection, upgrade_class):
|
||||||
|
|
||||||
|
|
||||||
# Base migration class. All future DB changes should be subclassed from this class
|
# Base migration class. All future DB changes should be subclassed from this class
|
||||||
class SchemaUpgrade(object):
|
class SchemaUpgrade:
|
||||||
def __init__(self, connection):
|
def __init__(self, connection):
|
||||||
self.connection = connection
|
self.connection = connection
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ if os.name == 'nt':
|
||||||
from winerror import ERROR_ALREADY_EXISTS
|
from winerror import ERROR_ALREADY_EXISTS
|
||||||
|
|
||||||
|
|
||||||
class WindowsProcess(object):
|
class WindowsProcess:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.mutex = None
|
self.mutex = None
|
||||||
self.mutexname = 'nzbtomedia_{pid}'.format(pid=core.PID_FILE.replace('\\', '/')) # {D0E858DF-985E-4907-B7FB-8D732C3FC3B9}'
|
self.mutexname = 'nzbtomedia_{pid}'.format(pid=core.PID_FILE.replace('\\', '/')) # {D0E858DF-985E-4907-B7FB-8D732C3FC3B9}'
|
||||||
|
@ -42,7 +42,7 @@ class WindowsProcess(object):
|
||||||
self.CloseHandle(self.mutex)
|
self.CloseHandle(self.mutex)
|
||||||
|
|
||||||
|
|
||||||
class PosixProcess(object):
|
class PosixProcess:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.pidpath = core.PID_FILE
|
self.pidpath = core.PID_FILE
|
||||||
self.lock_socket = None
|
self.lock_socket = None
|
||||||
|
|
|
@ -25,7 +25,7 @@ import core
|
||||||
from core import github_api as github, logger
|
from core import github_api as github, logger
|
||||||
|
|
||||||
|
|
||||||
class CheckVersion(object):
|
class CheckVersion:
|
||||||
"""Version checker that runs in a thread with the SB scheduler."""
|
"""Version checker that runs in a thread with the SB scheduler."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -88,7 +88,7 @@ class CheckVersion(object):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
class UpdateManager(object):
|
class UpdateManager:
|
||||||
def get_github_repo_user(self):
|
def get_github_repo_user(self):
|
||||||
return core.GIT_USER
|
return core.GIT_USER
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue