コード例 #1
0
ファイル: __init__.py プロジェクト: tioxxx/SiCKRAGE-1
sickrage.srConfig.LOG_FILE = os.path.join(sickrage.srConfig.LOG_DIR, 'sickrage.log')
sickrage.srConfig.LOG_NR = 5
sickrage.srConfig.LOG_SIZE = 1048576

sickrage.srLogger = srLogger(logFile=sickrage.srConfig.LOG_FILE,
                             logSize=sickrage.srConfig.LOG_SIZE,
                             logNr=sickrage.srConfig.LOG_NR,
                             fileLogging=sickrage.srConfig.LOG_DIR,
                             debugLogging=True)

sickrage.srConfig.GIT_USERNAME = sickrage.srConfig.check_setting_str('General', 'git_username', '')
sickrage.srConfig.GIT_PASSWORD = sickrage.srConfig.check_setting_str('General', 'git_password', '')

sickrage.srCore.providersDict = {
    GenericProvider.NZB: {p.id: p for p in NZBProvider.getProviderList()},
    GenericProvider.TORRENT: {p.id: p for p in TorrentProvider.getProviderList()},
}

sickrage.srCore.INDEXER_API = srIndexerApi
sickrage.srCore.SCHEDULER = srScheduler()
sickrage.srCore.NAMECACHE = srNameCache()

sickrage.srCore.NOTIFIERS = AttrDict(
    libnotify=LibnotifyNotifier(),
    kodi_notifier=KODINotifier(),
    plex_notifier=PLEXNotifier(),
    emby_notifier=EMBYNotifier(),
    nmj_notifier=NMJNotifier(),
    nmjv2_notifier=NMJv2Notifier(),
    synoindex_notifier=synoIndexNotifier(),
コード例 #2
0
ファイル: __init__.py プロジェクト: tioxxx/SiCKRAGE-1
    def __init__(self):
        self.STARTED = False
        self.PID = None

        # init system encoding
        self.SYS_ENCODING = encodingInit()

        # Check if we need to perform a restore first
        os.chdir(sickrage.DATA_DIR)
        restore_dir = os.path.join(sickrage.DATA_DIR, 'restore')
        if os.path.exists(restore_dir):
            success = restoreDB(restore_dir, sickrage.DATA_DIR)
            print("Restore: restoring DB and config.ini %s!\n" % ("FAILED", "SUCCESSFUL")[success])
            if success:
                os.execl(sys.executable, sys.executable, *sys.argv)

        # sickrage version
        self.VERSION = None
        self.NEWEST_VERSION = None
        self.NEWEST_VERSION_STRING = None

        # show list
        self.SHOWLIST = []

        # notifiers
        self.NOTIFIERS = AttrDict(
            libnotify=LibnotifyNotifier(),
            kodi_notifier=KODINotifier(),
            plex_notifier=PLEXNotifier(),
            emby_notifier=EMBYNotifier(),
            nmj_notifier=NMJNotifier(),
            nmjv2_notifier=NMJv2Notifier(),
            synoindex_notifier=synoIndexNotifier(),
            synology_notifier=synologyNotifier(),
            pytivo_notifier=pyTivoNotifier(),
            growl_notifier=GrowlNotifier(),
            prowl_notifier=ProwlNotifier(),
            libnotify_notifier=LibnotifyNotifier(),
            pushover_notifier=PushoverNotifier(),
            boxcar_notifier=BoxcarNotifier(),
            boxcar2_notifier=Boxcar2Notifier(),
            nma_notifier=NMA_Notifier(),
            pushalot_notifier=PushalotNotifier(),
            pushbullet_notifier=PushbulletNotifier(),
            freemobile_notifier=FreeMobileNotifier(),
            twitter_notifier=TwitterNotifier(),
            trakt_notifier=TraktNotifier(),
            email_notifier=EmailNotifier()
        )

        # services
        self.SCHEDULER = None
        self.WEBSERVER = None
        self.INDEXER_API = None
        self.VERSIONUPDATER = None

        # init caches
        self.NAMECACHE = None

        # init queues
        self.SHOWUPDATER = None
        self.SHOWQUEUE = None
        self.SEARCHQUEUE = None

        # init searchers
        self.DAILYSEARCHER = None
        self.BACKLOGSEARCHER = None
        self.PROPERSEARCHER = None
        self.TRAKTSEARCHER = None
        self.SUBTITLESEARCHER = None

        # init postprocessor
        self.AUTOPOSTPROCESSOR = None

        self.metadataProviderDict = None

        self.providersDict = {
            GenericProvider.NZB: {p.id: p for p in NZBProvider.getProviderList()},
            GenericProvider.TORRENT: {p.id: p for p in TorrentProvider.getProviderList()},
        }

        self.newznabProviderList = None
        self.torrentRssProviderList = None
コード例 #3
0
ファイル: __init__.py プロジェクト: ipmcc/SiCKRAGE
    def __init__(self, prog_dir, data_dir):
        self.STARTED = False
        self.PID = None

        # init system encoding
        self.SYS_ENCODING = encodingInit()

        # main program folder
        self.PROG_DIR = prog_dir

        # Make sure that we can create the data dir
        self.DATA_DIR = data_dir
        if not os.access(self.DATA_DIR, os.F_OK):
            try:
                os.makedirs(self.DATA_DIR, 0o744)
            except os.error:
                raise SystemExit("Unable to create data directory '" + self.DATA_DIR + "'")

        # Make sure we can write to the data dir
        if not os.access(self.DATA_DIR, os.W_OK):
            raise SystemExit("Data directory must be writeable '" + self.DATA_DIR + "'")

        # Check if we need to perform a restore first
        os.chdir(self.DATA_DIR)
        restore_dir = os.path.join(self.DATA_DIR, 'restore')
        if os.path.exists(restore_dir):
            success = restoreDB(restore_dir, self.DATA_DIR)
            print("Restore: restoring DB and config.ini %s!\n" % ("FAILED", "SUCCESSFUL")[success])
            if success:
                os.execl(sys.executable, sys.executable, *sys.argv)

        # sickrage version
        self.VERSION = None
        self.NEWEST_VERSION = None
        self.NEWEST_VERSION_STRING = None

        # show list
        self.SHOWLIST = []

        # notifiers
        self.NOTIFIERS = None

        # services
        self.SCHEDULER = None
        self.WEBSERVER = None
        self.INDEXER_API = None
        self.VERSIONUPDATER = None

        # init caches
        self.NAMECACHE = None

        # init queues
        self.SHOWUPDATER = None
        self.SHOWQUEUE = None
        self.SEARCHQUEUE = None

        # init searchers
        self.DAILYSEARCHER = None
        self.BACKLOGSEARCHER = None
        self.PROPERSEARCHER = None
        self.TRAKTSEARCHER = None
        self.SUBTITLESEARCHER = None

        # init postprocessor
        self.AUTOPOSTPROCESSOR = None

        self.metadataProviderDict = None

        self.providersDict = {
            GenericProvider.NZB: {p.id: p for p in NZBProvider.getProviderList()},
            GenericProvider.TORRENT: {p.id: p for p in TorrentProvider.getProviderList()},
        }

        self.newznabProviderList = None
        self.torrentRssProviderList = None