mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-05 17:05:03 -05:00
Merge remote-tracking branch 'origin/dev'
This commit is contained in:
commit
5f781bbf28
11
SickBeard.py
11
SickBeard.py
@ -18,10 +18,7 @@
|
||||
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Check needed software dependencies to nudge users to fix their setup
|
||||
import functools
|
||||
import sys
|
||||
import tornado.ioloop
|
||||
import tornado.autoreload
|
||||
|
||||
if sys.version_info < (2, 6):
|
||||
print "Sorry, requires Python 2.6 or 2.7."
|
||||
@ -56,6 +53,9 @@ import getopt
|
||||
|
||||
import sickbeard
|
||||
|
||||
import tornado.ioloop
|
||||
import tornado.autoreload
|
||||
|
||||
from sickbeard import db
|
||||
from sickbeard.tv import TVShow
|
||||
from sickbeard import logger
|
||||
@ -395,8 +395,9 @@ def main():
|
||||
sickbeard.cleanup_tornado_sockets(io_loop)
|
||||
|
||||
# autoreload.
|
||||
tornado.autoreload.start(io_loop)
|
||||
tornado.autoreload.add_reload_hook(autoreload_shutdown)
|
||||
if sickbeard.AUTO_UPDATE:
|
||||
tornado.autoreload.start(io_loop)
|
||||
tornado.autoreload.add_reload_hook(autoreload_shutdown)
|
||||
|
||||
# start IOLoop.
|
||||
io_loop.start()
|
||||
|
@ -17,7 +17,6 @@
|
||||
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import with_statement
|
||||
import traceback
|
||||
|
||||
import webbrowser
|
||||
import time
|
||||
|
@ -25,7 +25,7 @@ MESSAGE = 'notice'
|
||||
ERROR = 'error'
|
||||
|
||||
|
||||
class Notifications(RequestHandler):
|
||||
class Notifications(object):
|
||||
"""
|
||||
A queue of Notification objects.
|
||||
"""
|
||||
@ -71,7 +71,7 @@ class Notifications(RequestHandler):
|
||||
notifications = Notifications()
|
||||
|
||||
|
||||
class Notification(RequestHandler):
|
||||
class Notification(object):
|
||||
"""
|
||||
Represents a single notification. Tracks its own timeout and a list of which clients have
|
||||
seen it before.
|
||||
@ -81,8 +81,6 @@ class Notification(RequestHandler):
|
||||
self.title = title
|
||||
self.message = message
|
||||
|
||||
self.remote_ip = sickbeard.REMOTE_IP
|
||||
|
||||
self._when = datetime.datetime.now()
|
||||
self._seen = []
|
||||
|
||||
@ -100,7 +98,7 @@ class Notification(RequestHandler):
|
||||
"""
|
||||
Returns True if the notification hasn't been displayed to the current client (aka IP address).
|
||||
"""
|
||||
return self.remote_ip not in self._seen
|
||||
return sickbeard.REMOTE_IP not in self._seen
|
||||
|
||||
def is_expired(self):
|
||||
"""
|
||||
@ -113,7 +111,7 @@ class Notification(RequestHandler):
|
||||
"""
|
||||
Returns this notification object and marks it as seen by the client ip
|
||||
"""
|
||||
self._seen.append(self.remote_ip)
|
||||
self._seen.append(sickbeard.REMOTE_IP)
|
||||
return self
|
||||
|
||||
|
||||
|
@ -58,8 +58,7 @@ class CheckVersion():
|
||||
if sickbeard.AUTO_UPDATE:
|
||||
logger.log(u"New update found for SickRage, starting auto-updater ...")
|
||||
if sickbeard.versionCheckScheduler.action.update():
|
||||
logger.log(u"Update was successfull, auto-reloading SickRage ...")
|
||||
#threading.Timer(2, sickbeard.invoke_restart, [False]).start()
|
||||
logger.log(u"Update was successful!")
|
||||
|
||||
def find_install_type(self):
|
||||
"""
|
||||
|
@ -4209,7 +4209,7 @@ class UI(IndexHandler):
|
||||
ui.notifications.message('Test 1', 'This is test number 1')
|
||||
ui.notifications.error('Test 2', 'This is test number 2')
|
||||
|
||||
"ok"
|
||||
return "ok"
|
||||
|
||||
|
||||
def get_messages(self, *args, **kwargs):
|
||||
@ -4221,4 +4221,4 @@ class UI(IndexHandler):
|
||||
'type': cur_notification.type}
|
||||
cur_notification_num += 1
|
||||
|
||||
json.dumps(messages)
|
||||
return json.dumps(messages)
|
||||
|
@ -1,7 +1,6 @@
|
||||
import os
|
||||
import traceback
|
||||
import sickbeard
|
||||
from tornado.ioloop import IOLoop
|
||||
import webserve
|
||||
import webapi
|
||||
|
||||
@ -9,6 +8,7 @@ from sickbeard import logger
|
||||
from sickbeard.helpers import create_https_certificates
|
||||
from tornado.web import Application, StaticFileHandler, RedirectHandler, HTTPError
|
||||
from tornado.httpserver import HTTPServer
|
||||
from tornado.ioloop import IOLoop
|
||||
|
||||
server = None
|
||||
|
||||
@ -100,7 +100,7 @@ def initWebServer(options={}):
|
||||
log_function=lambda x: None,
|
||||
debug=False,
|
||||
gzip=True,
|
||||
autoreload=True,
|
||||
autoreload=sickbeard.AUTO_UPDATE,
|
||||
xheaders=True,
|
||||
cookie_secret='61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=',
|
||||
login_url='/login'
|
||||
|
Loading…
Reference in New Issue
Block a user