1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-04 15:12:23 -05:00

Added in context to aid in garbage cleanup to help reduce memory usage.

This commit is contained in:
echel0n 2014-06-30 10:48:18 -07:00
parent 2e8c8a262f
commit a1cef0b958
44 changed files with 240 additions and 18 deletions

View File

@ -42,3 +42,6 @@ class PostProcesser():
return return
processTV.processDir(sickbeard.TV_DOWNLOAD_DIR) processTV.processDir(sickbeard.TV_DOWNLOAD_DIR)
def __del__(self):
pass

View File

@ -35,6 +35,9 @@ class BlackAndWhiteList(object):
self.show_id = show_id self.show_id = show_id
self.refresh() self.refresh()
def __del__(self):
pass
def refresh(self): def refresh(self):
logger.log(u"Building black and white list for " + str(self.show_id), logger.DEBUG) logger.log(u"Building black and white list for " + str(self.show_id), logger.DEBUG)

View File

@ -36,6 +36,9 @@ class DailySearcher():
self.amActive = False self.amActive = False
def __del__(self):
pass
def run(self, force=False): def run(self, force=False):
self.amActive = True self.amActive = True

View File

@ -44,6 +44,9 @@ class FailedProcessor(object):
self.log = "" self.log = ""
def __del__(self):
pass
def process(self): def process(self):
self._log(u"Failed download detected: (" + str(self.nzb_name) + ", " + str(self.dir_name) + ")") self._log(u"Failed download detected: (" + str(self.nzb_name) + ", " + str(self.dir_name) + ")")

View File

@ -43,6 +43,9 @@ class GenericQueue(object):
self.lock = threading.Lock() self.lock = threading.Lock()
def __del__(self):
pass
def pause(self): def pause(self):
logger.log(u"Pausing queue") logger.log(u"Pausing queue")
self.min_priority = 999999999999 self.min_priority = 999999999999
@ -116,6 +119,9 @@ class QueueItem:
self.added = None self.added = None
def __del__(self):
pass
def get_thread_name(self): def get_thread_name(self):
if self.thread_name: if self.thread_name:
return self.thread_name return self.thread_name

View File

@ -33,6 +33,9 @@ class ImageCache:
def __init__(self): def __init__(self):
pass pass
def __del__(self):
pass
def _cache_dir(self): def _cache_dir(self):
""" """
Builds up the full path to the image cache directory Builds up the full path to the image cache directory

View File

@ -25,6 +25,9 @@ class indexerApi(object):
def __init__(self, indexerID=None): def __init__(self, indexerID=None):
self.indexerID = int(indexerID) if indexerID else None self.indexerID = int(indexerID) if indexerID else None
def __del__(self):
pass
def indexer(self, *args, **kwargs): def indexer(self, *args, **kwargs):
if self.indexerID: if self.indexerID:
return indexerConfig[self.indexerID]['module'](*args, **kwargs) return indexerConfig[self.indexerID]['module'](*args, **kwargs)

View File

@ -67,6 +67,9 @@ class SBRotatingLogHandler(object):
self.console_logging = False self.console_logging = False
self.log_lock = threading.Lock() self.log_lock = threading.Lock()
def __del__(self):
pass
def close_log(self, handler=None): def close_log(self, handler=None):
if not handler: if not handler:
handler = self.cur_handler handler = self.cur_handler
@ -302,6 +305,9 @@ class DispatchingFormatter:
self._formatters = formatters self._formatters = formatters
self._default_formatter = default_formatter self._default_formatter = default_formatter
def __del__(self):
pass
def format(self, record): def format(self, record):
formatter = self._formatters.get(record.name, self._default_formatter) formatter = self._formatters.get(record.name, self._default_formatter)
return formatter.format(record) return formatter.format(record)

View File

@ -31,6 +31,9 @@ class Maintenance():
self.amActive = False self.amActive = False
def __del__(self):
pass
def run(self, force=False): def run(self, force=False):
self.amActive = True self.amActive = True

View File

@ -45,6 +45,9 @@ class NameParser(object):
self.convert = convert self.convert = convert
self.naming_pattern = naming_pattern self.naming_pattern = naming_pattern
def __del__(self):
pass
def clean_series_name(self, series_name): def clean_series_name(self, series_name):
"""Cleans up series name by removing any . and _ """Cleans up series name by removing any . and _
characters, along with any trailing hyphens. characters, along with any trailing hyphens.
@ -443,6 +446,9 @@ class ParseResult(object):
self.show = show self.show = show
self.score = score self.score = score
def __del__(self):
pass
def __eq__(self, other): def __eq__(self, other):
if not other: if not other:
return False return False
@ -618,6 +624,8 @@ class NameParserCache(object):
logger.log("Using cached parse result for: " + name, logger.DEBUG) logger.log("Using cached parse result for: " + name, logger.DEBUG)
return self._previous_parsed[name] return self._previous_parsed[name]
def __del__(self):
pass
name_parser_cache = NameParserCache() name_parser_cache = NameParserCache()

View File

@ -96,6 +96,8 @@ class PostProcessor(object):
self.log = '' self.log = ''
def __del__(self):
pass
def _log(self, message, level=logger.MESSAGE): def _log(self, message, level=logger.MESSAGE):
""" """

View File

@ -40,6 +40,9 @@ class ProperFinder():
def __init__(self): def __init__(self):
self.amActive = False self.amActive = False
def __del__(self):
pass
def run(self, force=False): def run(self, force=False):
if not sickbeard.DOWNLOAD_PROPERS: if not sickbeard.DOWNLOAD_PROPERS:

View File

@ -49,6 +49,9 @@ class BTNProvider(generic.TorrentProvider):
self.url = "http://api.btnapps.net" self.url = "http://api.btnapps.net"
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -315,6 +318,9 @@ class BTNCache(tvcache.TVCache):
# At least 15 minutes between queries # At least 15 minutes between queries
self.minTime = 15 self.minTime = 15
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -47,6 +47,9 @@ class EZRSSProvider(generic.TorrentProvider):
self.url = 'https://www.ezrss.it/' self.url = 'https://www.ezrss.it/'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -178,6 +181,9 @@ class EZRSSCache(tvcache.TVCache):
# only poll EZRSS every 15 minutes max # only poll EZRSS every 15 minutes max
self.minTime = 15 self.minTime = 15
def __del__(self):
pass
def _getRSSData(self): def _getRSSData(self):
rss_url = self.provider.url + 'feed/' rss_url = self.provider.url + 'feed/'

View File

@ -45,6 +45,9 @@ class Fanzub(generic.NZBProvider):
self.url = 'http://fanzub.com/' self.url = 'http://fanzub.com/'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -131,6 +134,8 @@ class FanzubCache(tvcache.TVCache):
# we get 100 post each call ! # we get 100 post each call !
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def _getRSSData(self): def _getRSSData(self):

View File

@ -68,6 +68,9 @@ class GenericProvider:
self.session.headers.update({ self.session.headers.update({
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'}) 'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'})
def __del__(self):
pass
def getID(self): def getID(self):
return GenericProvider.makeID(self.name) return GenericProvider.makeID(self.name)
@ -406,9 +409,14 @@ class NZBProvider(GenericProvider):
self.providerType = GenericProvider.NZB self.providerType = GenericProvider.NZB
def __del__(self):
pass
class TorrentProvider(GenericProvider): class TorrentProvider(GenericProvider):
def __init__(self, name): def __init__(self, name):
GenericProvider.__init__(self, name) GenericProvider.__init__(self, name)
self.providerType = GenericProvider.TORRENT self.providerType = GenericProvider.TORRENT
def __del__(self):
pass

View File

@ -55,6 +55,9 @@ class HDBitsProvider(generic.TorrentProvider):
self.rss_url = 'http://hdbits.org/api/torrents' self.rss_url = 'http://hdbits.org/api/torrents'
self.download_url = 'http://hdbits.org/download.php?' self.download_url = 'http://hdbits.org/download.php?'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -214,6 +217,9 @@ class HDBitsCache(tvcache.TVCache):
# only poll HDBits every 15 minutes max # only poll HDBits every 15 minutes max
self.minTime = 15 self.minTime = 15
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -73,6 +73,9 @@ class HDTorrentsProvider(generic.TorrentProvider):
self.cookies = None self.cookies = None
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -351,6 +354,9 @@ class HDTorrentsCache(tvcache.TVCache):
# only poll HDTorrents every 10 minutes max # only poll HDTorrents every 10 minutes max
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -65,6 +65,9 @@ class IPTorrentsProvider(generic.TorrentProvider):
self.categorie = 'l73=1&l78=1&l66=1&l65=1&l79=1&l5=1&l4=1' self.categorie = 'l73=1&l78=1&l66=1&l65=1&l79=1&l5=1&l4=1'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -292,6 +295,9 @@ class IPTorrentsCache(tvcache.TVCache):
# Only poll IPTorrents every 10 minutes max # Only poll IPTorrents every 10 minutes max
self.minTime = 10 self.minTime = 10
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -68,6 +68,9 @@ class KATProvider(generic.TorrentProvider):
self.searchurl = self.url + 'usearch/%s/?field=seeders&sorder=desc' #order by seed self.searchurl = self.url + 'usearch/%s/?field=seeders&sorder=desc' #order by seed
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -430,6 +433,9 @@ class KATCache(tvcache.TVCache):
# only poll ThePirateBay every 10 minutes max # only poll ThePirateBay every 10 minutes max
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -40,6 +40,9 @@ class NewzbinDownloader(urllib.FancyURLopener):
def __init__(self): def __init__(self):
urllib.FancyURLopener.__init__(self) urllib.FancyURLopener.__init__(self)
def __del__(self):
pass
def http_error_default(self, url, fp, errcode, errmsg, headers): def http_error_default(self, url, fp, errcode, errmsg, headers):
# if newzbin is throttling us, wait seconds and try again # if newzbin is throttling us, wait seconds and try again
@ -73,6 +76,9 @@ class NewzbinProvider(generic.NZBProvider):
self.NEWZBIN_DATE_FORMAT = '%a, %d %b %Y %H:%M:%S %Z' self.NEWZBIN_DATE_FORMAT = '%a, %d %b %Y %H:%M:%S %Z'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return sickbeard.NEWZBIN return sickbeard.NEWZBIN
@ -334,6 +340,9 @@ class NewzbinCache(tvcache.TVCache):
# only poll Newzbin every 10 mins max # only poll Newzbin every 10 mins max
self.minTime = 1 self.minTime = 1
def __del__(self):
pass
def _getRSSData(self): def _getRSSData(self):
return self.provider._getRSSData() return self.provider._getRSSData()

View File

@ -69,6 +69,9 @@ class NewznabProvider(generic.NZBProvider):
self.default = False self.default = False
def __del__(self):
pass
def configStr(self): def configStr(self):
return self.name + '|' + self.url + '|' + self.key + '|' + self.catIDs + '|' + str(int(self.enabled)) + '|' + self.search_mode + '|' + str(int(self.search_fallback)) return self.name + '|' + self.url + '|' + self.key + '|' + self.catIDs + '|' + str(int(self.enabled)) + '|' + self.search_mode + '|' + str(int(self.search_fallback))
@ -292,6 +295,9 @@ class NewznabCache(tvcache.TVCache):
# only poll newznab providers every 15 minutes max # only poll newznab providers every 15 minutes max
self.minTime = 15 self.minTime = 15
def __del__(self):
pass
def _getRSSData(self): def _getRSSData(self):
params = {"t": "tvsearch", params = {"t": "tvsearch",

View File

@ -71,6 +71,9 @@ class NextGenProvider(generic.TorrentProvider):
self.login_opener = None self.login_opener = None
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -341,6 +344,9 @@ class NextGenCache(tvcache.TVCache):
# Only poll NextGen every 10 minutes max # Only poll NextGen every 10 minutes max
self.minTime = 10 self.minTime = 10
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -45,6 +45,9 @@ class NyaaProvider(generic.TorrentProvider):
self.url = 'http://www.nyaa.se/' self.url = 'http://www.nyaa.se/'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -127,6 +130,8 @@ class NyaaCache(tvcache.TVCache):
# only poll NyaaTorrents every 15 minutes max # only poll NyaaTorrents every 15 minutes max
self.minTime = 15 self.minTime = 15
def __del__(self):
pass
def _getRSSData(self): def _getRSSData(self):
params = { params = {

View File

@ -49,6 +49,9 @@ class OmgwtfnzbsProvider(generic.NZBProvider):
self.url = 'https://omgwtfnzbs.org/' self.url = 'https://omgwtfnzbs.org/'
self.supportsBacklog = True self.supportsBacklog = True
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -157,6 +160,9 @@ class OmgwtfnzbsCache(tvcache.TVCache):
tvcache.TVCache.__init__(self, provider) tvcache.TVCache.__init__(self, provider)
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def _getRSSData(self): def _getRSSData(self):
params = {'user': provider.username, params = {'user': provider.username,
'api': provider.api_key, 'api': provider.api_key,

View File

@ -67,6 +67,9 @@ class PublicHDProvider(generic.TorrentProvider):
self.categories = {'Season': ['23'], 'Episode': ['7', '14', '24'], 'RSS': ['7', '14', '23', '24']} self.categories = {'Season': ['23'], 'Episode': ['7', '14', '24'], 'RSS': ['7', '14', '23', '24']}
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -314,6 +317,9 @@ class PublicHDCache(tvcache.TVCache):
# only poll ThePirateBay every 10 minutes max # only poll ThePirateBay every 10 minutes max
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -52,6 +52,9 @@ class TorrentRssProvider(generic.TorrentProvider):
else: else:
self.cookies = '' self.cookies = ''
def __del__(self):
pass
def configStr(self): def configStr(self):
return self.name + '|' + self.url + '|' + self.cookies + '|' + str(int(self.enabled)) + '|' + self.search_mode + '|' + str(int(self.search_fallback)) + '|' + str(int(self.backlog_only)) return self.name + '|' + self.url + '|' + self.cookies + '|' + str(int(self.enabled)) + '|' + self.search_mode + '|' + str(int(self.search_fallback)) + '|' + str(int(self.backlog_only))
@ -170,6 +173,9 @@ class TorrentRssCache(tvcache.TVCache):
tvcache.TVCache.__init__(self, provider) tvcache.TVCache.__init__(self, provider)
self.minTime = 15 self.minTime = 15
def __del__(self):
pass
def _getRSSData(self): def _getRSSData(self):
logger.log(u"TorrentRssCache cache update URL: " + self.provider.url, logger.DEBUG) logger.log(u"TorrentRssCache cache update URL: " + self.provider.url, logger.DEBUG)
if self.provider.cookies: if self.provider.cookies:

View File

@ -73,6 +73,9 @@ class SCCProvider(generic.TorrentProvider):
self.headers = {'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} self.headers = {'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'}
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -336,6 +339,9 @@ class SCCCache(tvcache.TVCache):
# only poll SCC every 10 minutes max # only poll SCC every 10 minutes max
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -66,6 +66,9 @@ class SpeedCDProvider(generic.TorrentProvider):
self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c49': 1}, 'RSS': {'c14': 1, 'c2': 1, 'c49': 1}} self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c49': 1}, 'RSS': {'c14': 1, 'c2': 1, 'c49': 1}}
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -276,6 +279,9 @@ class SpeedCDCache(tvcache.TVCache):
# only poll Speedcd every 20 minutes max # only poll Speedcd every 20 minutes max
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -67,6 +67,9 @@ class ThePirateBayProvider(generic.TorrentProvider):
self.re_title_url = '/torrent/(?P<id>\d+)/(?P<title>.*?)//1".+?(?P<url>magnet.*?)//1".+?(?P<seeders>\d+)</td>.+?(?P<leechers>\d+)</td>' self.re_title_url = '/torrent/(?P<id>\d+)/(?P<title>.*?)//1".+?(?P<url>magnet.*?)//1".+?(?P<seeders>\d+)</td>.+?(?P<leechers>\d+)</td>'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -409,6 +412,9 @@ class ThePirateBayCache(tvcache.TVCache):
# only poll ThePirateBay every 10 minutes max # only poll ThePirateBay every 10 minutes max
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days
@ -471,6 +477,9 @@ class ThePirateBayWebproxy:
'Hiload.org (NL)': 'http://hiload.org/', 'Hiload.org (NL)': 'http://hiload.org/',
} }
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
""" Return True if we Choose to call TPB via Proxy """ """ Return True if we Choose to call TPB via Proxy """
return self.enabled return self.enabled

View File

@ -72,6 +72,9 @@ class TorrentDayProvider(generic.TorrentProvider):
self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1}, self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1},
'RSS': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1, 'c14': 1}} 'RSS': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1, 'c14': 1}}
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -300,6 +303,9 @@ class TorrentDayCache(tvcache.TVCache):
# Only poll IPTorrents every 10 minutes max # Only poll IPTorrents every 10 minutes max
self.minTime = 10 self.minTime = 10
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -67,6 +67,9 @@ class TorrentLeechProvider(generic.TorrentProvider):
self.categories = "2,26,27,32" self.categories = "2,26,27,32"
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -295,6 +298,9 @@ class TorrentLeechCache(tvcache.TVCache):
# only poll TorrentLeech every 20 minutes max # only poll TorrentLeech every 20 minutes max
self.minTime = 20 self.minTime = 20
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -47,6 +47,9 @@ class TvTorrentsProvider(generic.TorrentProvider):
self.url = 'http://www.tvtorrents.com/' self.url = 'http://www.tvtorrents.com/'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -86,6 +89,9 @@ class TvTorrentsCache(tvcache.TVCache):
# only poll TvTorrents every 15 minutes max # only poll TvTorrents every 15 minutes max
self.minTime = 15 self.minTime = 15
def __del__(self):
pass
def _getRSSData(self): def _getRSSData(self):
# These will be ignored on the serverside. # These will be ignored on the serverside.
ignore_regex = "all.month|month.of|season[\s\d]*complete" ignore_regex = "all.month|month.of|season[\s\d]*complete"

View File

@ -31,6 +31,9 @@ class WombleProvider(generic.NZBProvider):
self.cache = WombleCache(self) self.cache = WombleCache(self)
self.url = 'http://newshost.co.za/' self.url = 'http://newshost.co.za/'
def __del__(self):
pass
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
@ -41,6 +44,9 @@ class WombleCache(tvcache.TVCache):
# only poll Womble's Index every 15 minutes max # only poll Womble's Index every 15 minutes max
self.minTime = 15 self.minTime = 15
def __del__(self):
pass
def updateCache(self): def updateCache(self):
# delete anything older then 7 days # delete anything older then 7 days

View File

@ -23,23 +23,14 @@ class RSSFeeds:
logger.log(u"RSS error: " + ex(e), logger.ERROR) logger.log(u"RSS error: " + ex(e), logger.ERROR)
raise raise
def __enter__(self): def __del__(self):
return self
def __exit__(self, type, value, tb):
self.fc = None
self.fs.close() self.fs.close()
def clearCache(self, age=None): def clearCache(self, age=None):
if not self.fc: with feed_lock:
return self.fc.purge(age)
self.fc.purge(age)
def getRSSFeed(self, url, post_data=None, request_headers=None):
if not self.fc:
return
def getFeed(self, url, post_data=None, request_headers=None):
with feed_lock: with feed_lock:
parsed = list(urlparse.urlparse(url)) parsed = list(urlparse.urlparse(url))
parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one
@ -59,4 +50,4 @@ class RSSFeeds:
logger.log(u"No RSS items found using URL: " + url, logger.WARNING) logger.log(u"No RSS items found using URL: " + url, logger.WARNING)
return return
return feed return feed

View File

@ -44,6 +44,9 @@ class Scheduler:
self.abort = False self.abort = False
self.force = False self.force = False
def __del__(self):
pass
def initThread(self): def initThread(self):
if self.thread == None or not self.thread.isAlive(): if self.thread == None or not self.thread.isAlive():
self.thread = threading.Thread(None, self.runAction, self.threadName) self.thread = threading.Thread(None, self.runAction, self.threadName)

View File

@ -40,6 +40,8 @@ class BacklogSearchScheduler(scheduler.Scheduler):
else: else:
return datetime.date.fromordinal(self.action._lastBacklog + self.action.cycleTime) return datetime.date.fromordinal(self.action._lastBacklog + self.action.cycleTime)
def __del__(self):
pass
class BacklogSearcher: class BacklogSearcher:
def __init__(self): def __init__(self):
@ -53,6 +55,9 @@ class BacklogSearcher:
self._resetPI() self._resetPI()
def __del__(self):
pass
def _resetPI(self): def _resetPI(self):
self.percentDone = 0 self.percentDone = 0
self.currentSearchInfo = {'title': 'Initializing'} self.currentSearchInfo = {'title': 'Initializing'}

View File

@ -43,6 +43,9 @@ class SearchQueue(generic_queue.GenericQueue):
generic_queue.GenericQueue.__init__(self) generic_queue.GenericQueue.__init__(self)
self.queue_name = "SEARCHQUEUE" self.queue_name = "SEARCHQUEUE"
def __del__(self):
pass
def is_in_queue(self, show, segment): def is_in_queue(self, show, segment):
for cur_item in self.queue: for cur_item in self.queue:
if isinstance(cur_item, BacklogQueueItem) and cur_item.show == show and cur_item.segment == segment: if isinstance(cur_item, BacklogQueueItem) and cur_item.show == show and cur_item.segment == segment:
@ -93,6 +96,9 @@ class DailySearchQueueItem(generic_queue.QueueItem):
self.show = show self.show = show
self.segment = segment self.segment = segment
def __del__(self):
pass
def execute(self): def execute(self):
generic_queue.QueueItem.execute(self) generic_queue.QueueItem.execute(self)
@ -125,6 +131,9 @@ class ManualSearchQueueItem(generic_queue.QueueItem):
self.show = show self.show = show
self.segment = segment self.segment = segment
def __del__(self):
pass
def execute(self): def execute(self):
generic_queue.QueueItem.execute(self) generic_queue.QueueItem.execute(self)
@ -168,6 +177,9 @@ class BacklogQueueItem(generic_queue.QueueItem):
self.show = show self.show = show
self.segment = segment self.segment = segment
def __del__(self):
pass
def execute(self): def execute(self):
generic_queue.QueueItem.execute(self) generic_queue.QueueItem.execute(self)
@ -211,6 +223,9 @@ class FailedQueueItem(generic_queue.QueueItem):
self.segment = segment self.segment = segment
self.success = None self.success = None
def __del__(self):
pass
def execute(self): def execute(self):
generic_queue.QueueItem.execute(self) generic_queue.QueueItem.execute(self)

View File

@ -103,3 +103,6 @@ class ShowUpdater():
ui.ProgressIndicators.setIndicator('dailyUpdate', ui.QueueProgressIndicator("Daily Update", piList)) ui.ProgressIndicators.setIndicator('dailyUpdate', ui.QueueProgressIndicator("Daily Update", piList))
logger.log(u"Completed full update on all shows") logger.log(u"Completed full update on all shows")
def __del__(self):
pass

View File

@ -33,6 +33,9 @@ class TraktChecker():
self.todoWanted = [] self.todoWanted = []
self.todoBacklog = [] self.todoBacklog = []
def __del__(self):
pass
def run(self, force=False): def run(self, force=False):
# add shows from trakt.tv watchlist # add shows from trakt.tv watchlist
if sickbeard.TRAKT_USE_WATCHLIST: if sickbeard.TRAKT_USE_WATCHLIST:

View File

@ -103,6 +103,9 @@ class TVShow(object):
self.loadFromDB() self.loadFromDB()
def __del__(self):
pass
name = property(lambda self: self._name, dirty_setter("_name")) name = property(lambda self: self._name, dirty_setter("_name"))
indexerid = property(lambda self: self._indexerid, dirty_setter("_indexerid")) indexerid = property(lambda self: self._indexerid, dirty_setter("_indexerid"))
indexer = property(lambda self: self._indexer, dirty_setter("_indexer")) indexer = property(lambda self: self._indexer, dirty_setter("_indexer"))
@ -1348,6 +1351,9 @@ class TVEpisode(object):
self.checkForMetaFiles() self.checkForMetaFiles()
def __del__(self):
pass
name = property(lambda self: self._name, dirty_setter("_name")) name = property(lambda self: self._name, dirty_setter("_name"))
season = property(lambda self: self._season, dirty_setter("_season")) season = property(lambda self: self._season, dirty_setter("_season"))
episode = property(lambda self: self._episode, dirty_setter("_episode")) episode = property(lambda self: self._episode, dirty_setter("_episode"))

View File

@ -68,6 +68,8 @@ class CacheDBConnection(db.DBConnection):
if str(e) != "table lastUpdate already exists": if str(e) != "table lastUpdate already exists":
raise raise
def __del__(self):
pass
class TVCache(): class TVCache():
def __init__(self, provider): def __init__(self, provider):
@ -76,6 +78,9 @@ class TVCache():
self.providerID = self.provider.getID() self.providerID = self.provider.getID()
self.minTime = 10 self.minTime = 10
def __del__(self):
pass
def _getDB(self): def _getDB(self):
return CacheDBConnection(self.providerID) return CacheDBConnection(self.providerID)
@ -134,9 +139,7 @@ class TVCache():
return [] return []
def getRSSFeed(self, url, post_data=None, request_headers=None): def getRSSFeed(self, url, post_data=None, request_headers=None):
with RSSFeeds(self.providerID) as feed: return RSSFeeds(self.providerID).getFeed(url, post_data, request_headers)
data = feed.getRSSFeed(url, post_data, request_headers)
return data
def _translateTitle(self, title): def _translateTitle(self, title):
return title.replace(' ', '.') return title.replace(' ', '.')

View File

@ -30,6 +30,9 @@ class Notifications(object):
self._messages = [] self._messages = []
self._errors = [] self._errors = []
def __del__(self):
pass
def message(self, title, message=''): def message(self, title, message=''):
""" """
Add a regular notification to the queue Add a regular notification to the queue
@ -89,6 +92,9 @@ class Notification(object):
else: else:
self._timeout = datetime.timedelta(minutes=1) self._timeout = datetime.timedelta(minutes=1)
def __del__(self):
pass
def is_new(self, remote_ip='127.0.0.1'): def is_new(self, remote_ip='127.0.0.1'):
""" """
Returns True if the notification hasn't been displayed to the current client (aka IP address). Returns True if the notification hasn't been displayed to the current client (aka IP address).

View File

@ -53,6 +53,9 @@ class CheckVersion():
else: else:
self.updater = None self.updater = None
def __del__(self):
pass
def run(self, force=False): def run(self, force=False):
if self.check_for_new_version(): if self.check_for_new_version():
if sickbeard.AUTO_UPDATE: if sickbeard.AUTO_UPDATE: