SSL issues fixed.

UI Notifications fixed.
Auto-updating option fixed to now work with auto-reload feature.
This commit is contained in:
echel0n 2014-06-16 05:19:07 -07:00
parent 489a181cdb
commit dccf371ebd
6 changed files with 15 additions and 18 deletions

View file

@ -18,10 +18,7 @@
# along with SickRage. If not, see <http://www.gnu.org/licenses/>. # along with SickRage. If not, see <http://www.gnu.org/licenses/>.
# Check needed software dependencies to nudge users to fix their setup # Check needed software dependencies to nudge users to fix their setup
import functools
import sys import sys
import tornado.ioloop
import tornado.autoreload
if sys.version_info < (2, 6): if sys.version_info < (2, 6):
print "Sorry, requires Python 2.6 or 2.7." print "Sorry, requires Python 2.6 or 2.7."
@ -56,6 +53,9 @@ import getopt
import sickbeard import sickbeard
import tornado.ioloop
import tornado.autoreload
from sickbeard import db from sickbeard import db
from sickbeard.tv import TVShow from sickbeard.tv import TVShow
from sickbeard import logger from sickbeard import logger
@ -395,8 +395,9 @@ def main():
sickbeard.cleanup_tornado_sockets(io_loop) sickbeard.cleanup_tornado_sockets(io_loop)
# autoreload. # autoreload.
tornado.autoreload.start(io_loop) if sickbeard.AUTO_UPDATE:
tornado.autoreload.add_reload_hook(autoreload_shutdown) tornado.autoreload.start(io_loop)
tornado.autoreload.add_reload_hook(autoreload_shutdown)
# start IOLoop. # start IOLoop.
io_loop.start() io_loop.start()

View file

@ -17,7 +17,6 @@
# along with SickRage. If not, see <http://www.gnu.org/licenses/>. # along with SickRage. If not, see <http://www.gnu.org/licenses/>.
from __future__ import with_statement from __future__ import with_statement
import traceback
import webbrowser import webbrowser
import time import time

View file

@ -25,7 +25,7 @@ MESSAGE = 'notice'
ERROR = 'error' ERROR = 'error'
class Notifications(RequestHandler): class Notifications(object):
""" """
A queue of Notification objects. A queue of Notification objects.
""" """
@ -71,7 +71,7 @@ class Notifications(RequestHandler):
notifications = Notifications() notifications = Notifications()
class Notification(RequestHandler): class Notification(object):
""" """
Represents a single notification. Tracks its own timeout and a list of which clients have Represents a single notification. Tracks its own timeout and a list of which clients have
seen it before. seen it before.
@ -81,8 +81,6 @@ class Notification(RequestHandler):
self.title = title self.title = title
self.message = message self.message = message
self.remote_ip = sickbeard.REMOTE_IP
self._when = datetime.datetime.now() self._when = datetime.datetime.now()
self._seen = [] 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). 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): def is_expired(self):
""" """
@ -113,7 +111,7 @@ class Notification(RequestHandler):
""" """
Returns this notification object and marks it as seen by the client ip 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 return self

View file

@ -58,8 +58,7 @@ class CheckVersion():
if sickbeard.AUTO_UPDATE: if sickbeard.AUTO_UPDATE:
logger.log(u"New update found for SickRage, starting auto-updater ...") logger.log(u"New update found for SickRage, starting auto-updater ...")
if sickbeard.versionCheckScheduler.action.update(): if sickbeard.versionCheckScheduler.action.update():
logger.log(u"Update was successfull, auto-reloading SickRage ...") logger.log(u"Update was successful!")
#threading.Timer(2, sickbeard.invoke_restart, [False]).start()
def find_install_type(self): def find_install_type(self):
""" """

View file

@ -4209,7 +4209,7 @@ class UI(IndexHandler):
ui.notifications.message('Test 1', 'This is test number 1') ui.notifications.message('Test 1', 'This is test number 1')
ui.notifications.error('Test 2', 'This is test number 2') ui.notifications.error('Test 2', 'This is test number 2')
"ok" return "ok"
def get_messages(self, *args, **kwargs): def get_messages(self, *args, **kwargs):
@ -4221,4 +4221,4 @@ class UI(IndexHandler):
'type': cur_notification.type} 'type': cur_notification.type}
cur_notification_num += 1 cur_notification_num += 1
json.dumps(messages) return json.dumps(messages)

View file

@ -1,7 +1,6 @@
import os import os
import traceback import traceback
import sickbeard import sickbeard
from tornado.ioloop import IOLoop
import webserve import webserve
import webapi import webapi
@ -9,6 +8,7 @@ from sickbeard import logger
from sickbeard.helpers import create_https_certificates from sickbeard.helpers import create_https_certificates
from tornado.web import Application, StaticFileHandler, RedirectHandler, HTTPError from tornado.web import Application, StaticFileHandler, RedirectHandler, HTTPError
from tornado.httpserver import HTTPServer from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
server = None server = None
@ -100,7 +100,7 @@ def initWebServer(options={}):
log_function=lambda x: None, log_function=lambda x: None,
debug=False, debug=False,
gzip=True, gzip=True,
autoreload=True, autoreload=sickbeard.AUTO_UPDATE,
xheaders=True, xheaders=True,
cookie_secret='61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=', cookie_secret='61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=',
login_url='/login' login_url='/login'