本文整理汇总了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]))
示例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
示例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()
示例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()
示例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])
示例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)
示例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
示例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)
示例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()
示例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
示例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()
示例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)
示例13: run
def run(self):
self.check_for_new_version()
# refresh scene exceptions too
scene_exceptions.retrieve_exceptions()
示例14: setUp
def setUp(self):
super(SceneExceptionTestCase, self).setUp()
scene_exceptions.retrieve_exceptions()
示例15: setUp
def setUp(self):
"""
Set up tests
"""
super(SceneExceptionTestCase, self).setUp()
scene_exceptions.retrieve_exceptions()