From ec0026bbf9561f28fe5dba9969b072dc0de2657a Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Sat, 10 Dec 2011 16:16:34 +0100 Subject: [PATCH] use IPythons config subsystem to allow overrides to the tornado web app. --- IPython/frontend/html/notebook/notebookapp.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py index e7a00c0cd..870bfb701 100644 --- a/IPython/frontend/html/notebook/notebookapp.py +++ b/IPython/frontend/html/notebook/notebookapp.py @@ -89,6 +89,10 @@ ipython notebook --port=5555 --ip=* # Listen on port 5555, all interfaces class NotebookWebApplication(web.Application): + settings = Dict(config=True, + help="Supply overrides for the tornado.web.Application, that the " + "IPython notebook uses.") + def __init__(self, ipython_app, kernel_manager, notebook_manager, log): handlers = [ (r"/", ProjectDashboardHandler), @@ -111,7 +115,11 @@ class NotebookWebApplication(web.Application): cookie_secret=os.urandom(1024), login_url="/login", ) - web.Application.__init__(self, handlers, **settings) + + # allow custom overrides for the tornado web app. + settings.update(self.settings) + + super(NotebookWebApplication, self).__init__(self, handlers, **settings) self.kernel_manager = kernel_manager self.log = log