mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-08 11:03:38 +00:00
Fix for nullhandler issues for py2.6 users,
Fix for rsstorrents.
This commit is contained in:
parent
1ba2b36c93
commit
98ff924b1c
3 changed files with 27 additions and 33 deletions
|
@ -48,6 +48,10 @@ reverseNames = {u'ERROR': ERROR,
|
||||||
u'DEBUG': DEBUG,
|
u'DEBUG': DEBUG,
|
||||||
u'DB': DB}
|
u'DB': DB}
|
||||||
|
|
||||||
|
# send logging to null
|
||||||
|
class NullHandler(logging.Handler):
|
||||||
|
def emit(self, record):
|
||||||
|
pass
|
||||||
|
|
||||||
class SBRotatingLogHandler(object):
|
class SBRotatingLogHandler(object):
|
||||||
def __init__(self, log_file, num_files, num_bytes):
|
def __init__(self, log_file, num_files, num_bytes):
|
||||||
|
@ -143,8 +147,7 @@ class SBRotatingLogHandler(object):
|
||||||
logging.getLogger('subliminal').setLevel(log_level)
|
logging.getLogger('subliminal').setLevel(log_level)
|
||||||
logging.getLogger('imdbpy').setLevel(log_level)
|
logging.getLogger('imdbpy').setLevel(log_level)
|
||||||
|
|
||||||
# send logging to null
|
logging.getLogger('tornado.access').addHandler(NullHandler())
|
||||||
logging.getLogger('tornado.access').addHandler(logging.NullHandler())
|
|
||||||
|
|
||||||
# already logging in new log folder, close the old handler
|
# already logging in new log folder, close the old handler
|
||||||
if old_handler:
|
if old_handler:
|
||||||
|
|
|
@ -50,7 +50,7 @@ class TorrentRssProvider(generic.TorrentProvider):
|
||||||
if cookies:
|
if cookies:
|
||||||
self.cookies = cookies
|
self.cookies = cookies
|
||||||
else:
|
else:
|
||||||
self.cookies = None
|
self.cookies = ''
|
||||||
|
|
||||||
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))
|
||||||
|
|
|
@ -23,6 +23,7 @@ import inspect
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
import traceback
|
||||||
import urllib
|
import urllib
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
@ -200,33 +201,27 @@ class IndexHandler(RedirectHandler):
|
||||||
if self.request.uri != ('/'):
|
if self.request.uri != ('/'):
|
||||||
raise HTTPError(404)
|
raise HTTPError(404)
|
||||||
|
|
||||||
def get_response(self):
|
|
||||||
raise gen.Return('hello')
|
|
||||||
|
|
||||||
def get_current_user(self):
|
def get_current_user(self):
|
||||||
return self.get_secure_cookie("user")
|
return self.get_secure_cookie("user")
|
||||||
|
|
||||||
@authenticated
|
@authenticated
|
||||||
@asynchronous
|
@asynchronous
|
||||||
@gen.coroutine
|
|
||||||
def get(self, *args, **kwargs):
|
def get(self, *args, **kwargs):
|
||||||
try:
|
|
||||||
resp = yield self.get_response()
|
|
||||||
self.finish(resp)
|
|
||||||
except Exception as e:
|
|
||||||
logger.log(e, logger.ERROR)
|
|
||||||
self.finish()
|
|
||||||
|
|
||||||
@gen.coroutine
|
|
||||||
def get_response(self):
|
|
||||||
raise gen.Return(self._dispatch())
|
|
||||||
|
|
||||||
def post(self, *args, **kwargs):
|
|
||||||
try:
|
try:
|
||||||
self.finish(self._dispatch())
|
self.finish(self._dispatch())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.log(e, logger.ERROR)
|
logger.log(ex(e), logger.ERROR)
|
||||||
self.finish()
|
logger.log(u"Traceback: " + traceback.format_exc(), logger.DEBUG)
|
||||||
|
self.finish(ex(e))
|
||||||
|
|
||||||
|
def post(self, *args, **kwargs):
|
||||||
|
try:
|
||||||
|
resp = self._dispatch()
|
||||||
|
self.finish(resp)
|
||||||
|
except Exception as e:
|
||||||
|
logger.log(ex(e), logger.ERROR)
|
||||||
|
logger.log(u"Traceback: " + traceback.format_exc(), logger.DEBUG)
|
||||||
|
self.finish(ex(e))
|
||||||
|
|
||||||
def robots_txt(self, *args, **kwargs):
|
def robots_txt(self, *args, **kwargs):
|
||||||
""" Keep web crawlers out """
|
""" Keep web crawlers out """
|
||||||
|
@ -550,7 +545,6 @@ def _getEpisode(show, season=None, episode=None, absolute=None):
|
||||||
|
|
||||||
return epObj
|
return epObj
|
||||||
|
|
||||||
|
|
||||||
def ManageMenu():
|
def ManageMenu():
|
||||||
manageMenu = [
|
manageMenu = [
|
||||||
{'title': 'Backlog Overview', 'path': 'manage/backlogOverview/'},
|
{'title': 'Backlog Overview', 'path': 'manage/backlogOverview/'},
|
||||||
|
@ -625,17 +619,6 @@ class ManageSearches(IndexHandler):
|
||||||
|
|
||||||
self.redirect("/manage/manageSearches/")
|
self.redirect("/manage/manageSearches/")
|
||||||
|
|
||||||
|
|
||||||
def forceVersionCheck(self, *args, **kwargs):
|
|
||||||
|
|
||||||
# force a check to see if there is a new version
|
|
||||||
result = sickbeard.versionCheckScheduler.action.check_for_new_version(force=True) # @UndefinedVariable
|
|
||||||
if result:
|
|
||||||
logger.log(u"Forcing version check")
|
|
||||||
|
|
||||||
self.redirect("/manage/manageSearches/")
|
|
||||||
|
|
||||||
|
|
||||||
class Manage(IndexHandler):
|
class Manage(IndexHandler):
|
||||||
def index(self, *args, **kwargs):
|
def index(self, *args, **kwargs):
|
||||||
t = PageTemplate(file="manage.tmpl")
|
t = PageTemplate(file="manage.tmpl")
|
||||||
|
@ -2485,6 +2468,14 @@ class HomePostProcess(IndexHandler):
|
||||||
return _munge(t)
|
return _munge(t)
|
||||||
|
|
||||||
|
|
||||||
|
def forceVersionCheck(self, *args, **kwargs):
|
||||||
|
|
||||||
|
# force a check to see if there is a new version
|
||||||
|
if sickbeard.versionCheckScheduler.action.check_for_new_version(force=True):
|
||||||
|
logger.log(u"Forcing version check")
|
||||||
|
|
||||||
|
self.redirect("/home/")
|
||||||
|
|
||||||
def processEpisode(self, dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None,
|
def processEpisode(self, dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None,
|
||||||
is_priority=None, failed="0", type="auto"):
|
is_priority=None, failed="0", type="auto"):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue