当前位置: 首页>>代码示例>>Python>>正文


Python scene_exceptions.retrieve_exceptions函数代码示例

本文整理汇总了Python中sickbeard.scene_exceptions.retrieve_exceptions函数的典型用法代码示例。如果您正苦于以下问题:Python retrieve_exceptions函数的具体用法?Python retrieve_exceptions怎么用?Python retrieve_exceptions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了retrieve_exceptions函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: buildNameCache

def buildNameCache(show=None):
    """Build internal name cache

    :param show: Specify show to build name cache for, if None, just do all shows
    """
    with nameCacheLock:
        scene_exceptions.retrieve_exceptions()

    if not show:
        logging.info("Building internal name cache for all shows")
        for show in sickbeard.showList:
            buildNameCache(show)
    else:
        logging.debug("Building internal name cache for [{}]".format(show.name))
        clearCache(show.indexerid)
        for curSeason in [-1] + scene_exceptions.get_scene_seasons(show.indexerid):
            for name in list(set(scene_exceptions.get_scene_exceptions(show.indexerid, season=curSeason) + [
                show.name])):
                name = sickbeard.helpers.full_sanitizeSceneName(name)
                if name in nameCache:
                    continue

                nameCache[name] = int(show.indexerid)
        logging.debug("Internal name cache for {} set to: [{}]".format(show.name,
                                                                     [key for key, value in nameCache.items() if
                                                                      value == show.indexerid]))
开发者ID:coderbone,项目名称:SickRage,代码行数:26,代码来源:name_cache.py

示例2: check_for_new_version

    def check_for_new_version(self, force=False):
        """
        Checks the internet for a newer version.
        
        returns: bool, True for new version or False for no new version.
        
        force: if true the VERSION_NOTIFY setting will be ignored and a check will be forced
        """

        # refresh scene exceptions too
        scene_exceptions.retrieve_exceptions()
        ui.notifications.message('Updateing scene exceptions')

        if not sickbeard.VERSION_NOTIFY and not force:
            logger.log(u"Version checking is disabled, not checking for the newest version")
            return False

        logger.log(u"Checking if "+self.install_type+" needs an update")
        if not self.updater.need_update():
            logger.log(u"No update needed")
            if force:
                ui.notifications.message('No update needed')
            return False

        self.updater.set_newest_text()
        return True
开发者ID:Pakoach,项目名称:Sick-Beard-Animes,代码行数:26,代码来源:versionChecker.py

示例3: run

 def run(self):
     self.check_for_new_version()
     
     # refresh scene exceptions too
     scene_exceptions.retrieve_exceptions()
     
     # refresh network timezones
     network_timezones.update_network_dict()
开发者ID:magicseb,项目名称:Sick-Beard,代码行数:8,代码来源:versionChecker.py

示例4: run

    def run(self):
        self.check_for_new_version()

        # refresh scene exceptions too
        scene_exceptions.retrieve_exceptions()

        # sure, why not?
        if sickbeard.USE_FAILED_DOWNLOADS:
            failed_history.trimHistory()
开发者ID:meza,项目名称:Sick-Beard-TPB,代码行数:9,代码来源:versionChecker.py

示例5: test_sceneExceptionByNameAnime

 def test_sceneExceptionByNameAnime(self):
     sickbeard.showList = None
     sickbeard.showList = [Show(1, 79604), Show(1, 295243)]
     sickbeard.showList[0].anime = 1
     sickbeard.showList[1].anime = 1
     scene_exceptions.retrieve_exceptions()
     name_cache.buildNameCache()
     self.assertEqual(scene_exceptions.get_scene_exception_by_name(u'ブラック・ラグーン'), [79604, -1])
     self.assertEqual(scene_exceptions.get_scene_exception_by_name(u'Burakku Ragūn'), [79604, -1])
     self.assertEqual(scene_exceptions.get_scene_exception_by_name('Rokka no Yuusha'), [295243, -1])
开发者ID:JackDandy,项目名称:SickGear,代码行数:10,代码来源:scene_helpers_tests.py

示例6: test_sceneExceptionsResetNameCache

    def test_sceneExceptionsResetNameCache(self):
        # clear the exceptions
        myDB = db.DBConnection("cache.db")
        myDB.action("DELETE FROM scene_exceptions")

        # put something in the cache
        name_cache.addNameToCache('Cached Name', 0)

        # updating should not clear the cache this time since our exceptions didn't change
        scene_exceptions.retrieve_exceptions()
        self.assertEqual(name_cache.retrieveNameFromCache('Cached Name'), 0)
开发者ID:coderbone,项目名称:SickRage,代码行数:11,代码来源:test_scene_helpers.py

示例7: run

    def run(self, force=False):
        self.amActive = True

        # get and update scene exceptions lists
        scene_exceptions.retrieve_exceptions()

        # refresh network timezones
        network_timezones.update_network_dict()

        # sure, why not?
        if sickbeard.USE_FAILED_DOWNLOADS:
            failed_history.trimHistory()

        self.amActive = False
开发者ID:achlee,项目名称:SickRage,代码行数:14,代码来源:maintenance.py

示例8: test_scene_ex_reset_name_cache

    def test_scene_ex_reset_name_cache(self):
        """
        Test scene exceptions reset name cache
        """
        # clear the exceptions
        test_cache_db_con = db.DBConnection('cache.db')
        test_cache_db_con.action("DELETE FROM scene_exceptions")

        # put something in the cache
        name_cache.addNameToCache('Cached Name', 0)

        # updating should not clear the cache this time since our exceptions didn't change
        scene_exceptions.retrieve_exceptions()
        self.assertEqual(name_cache.retrieveNameFromCache('Cached Name'), 0)
开发者ID:Arcanemagus,项目名称:SickRage,代码行数:14,代码来源:scene_helpers_tests.py

示例9: run

    def run(self):
        if self.check_for_new_version():
           if sickbeard.AUTO_UPDATE:
            logger.log(u"New update found for SickBeard, starting auto-updater ...")
            updated = sickbeard.versionCheckScheduler.action.update()
            if updated:
                logger.log(u"Update was successfull, restarting SickBeard ...")
                sickbeard.restart(False)

        # refresh scene exceptions too
        scene_exceptions.retrieve_exceptions()

        # refresh network timezones
        network_timezones.update_network_dict()

        # sure, why not?
        if sickbeard.USE_FAILED_DOWNLOADS:
            failed_history.trimHistory()
开发者ID:3ne,项目名称:SickRage,代码行数:18,代码来源:versionChecker.py

示例10: run

    def run(self, force=False):
        self.amActive = True

        # clear internal name cache
        name_cache.clearCache()

        # get and update scene exceptions lists
        scene_exceptions.retrieve_exceptions()

        # build internal name cache for searches and parsing
        name_cache.buildNameCache()

        # refresh network timezones
        network_timezones.update_network_dict()

        # sure, why not?
        if sickbeard.USE_FAILED_DOWNLOADS:
            failed_history.trimHistory()

        self.amActive = False
开发者ID:tcavallari,项目名称:SickRage,代码行数:20,代码来源:maintenance.py

示例11: run

    def run(self):
        updated = None
        if self.check_for_new_version():
            if sickbeard.AUTO_UPDATE:
                logger.log(u"New update found for SickRage, starting auto-updater ...")
                updated = sickbeard.versionCheckScheduler.action.update()
                if updated:
                    logger.log(u"Update was successfull, restarting SickRage ...")

                    # do a soft restart
                    threading.Timer(2, sickbeard.invoke_restart, [False]).start()

        if not updated:
            # refresh scene exceptions too
            scene_exceptions.retrieve_exceptions()

            # refresh network timezones
            network_timezones.update_network_dict()

            # sure, why not?
            if sickbeard.USE_FAILED_DOWNLOADS:
                failed_history.trimHistory()
开发者ID:Dahlgren,项目名称:SickRage,代码行数:22,代码来源:versionChecker.py

示例12: buildNameCache

def buildNameCache(show=None):
    """Build internal name cache

    :param show: Specify show to build name cache for, if None, just do all shows
    """
    with nameCacheLock:
        retrieve_exceptions()

    if not show:
        # logger.log(u"Building internal name cache for all shows", logger.INFO)
        for show in sickbeard.showList:
            buildNameCache(show)
    else:
        # logger.log(u"Building internal name cache for " + show.name, logger.DEBUG)
        clearCache(show.indexerid)
        for curSeason in [-1] + get_scene_seasons(show.indexerid):
            for name in set(get_scene_exceptions(show.indexerid, season=curSeason) + [show.name]):
                name = full_sanitizeSceneName(name)
                if name in nameCache:
                    continue

                nameCache[name] = int(show.indexerid)
        logger.log(u"Internal name cache for " + show.name + " set to: [ " + u', '.join([key for key, value in iteritems(nameCache) if value == show.indexerid]) + " ]", logger.DEBUG)
开发者ID:Eiber,项目名称:SickRage-Medusa,代码行数:23,代码来源:name_cache.py

示例13: run

    def run(self):
        self.check_for_new_version()

        # refresh scene exceptions too
        scene_exceptions.retrieve_exceptions()
开发者ID:DanaMcCarthy,项目名称:Sick-Beard,代码行数:5,代码来源:versionChecker.py

示例14: setUp

 def setUp(self):
     super(SceneExceptionTestCase, self).setUp()
     scene_exceptions.retrieve_exceptions()
开发者ID:3ne,项目名称:SickRage,代码行数:3,代码来源:scene_helpers_tests.py

示例15: setUp

 def setUp(self):
     """
     Set up tests
     """
     super(SceneExceptionTestCase, self).setUp()
     scene_exceptions.retrieve_exceptions()
开发者ID:feld,项目名称:SickRage,代码行数:6,代码来源:scene_helpers_tests.py


注:本文中的sickbeard.scene_exceptions.retrieve_exceptions函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。