From 53de43e90c5458a16e46aee9904e3c01c4644c25 2013-10-17 21:07:49 From: Zachary Sailer Date: 2013-10-17 21:07:49 Subject: [PATCH] manual rebase notebookapp.py --- diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py index 206473c..fc0248e 100644 --- a/IPython/html/notebookapp.py +++ b/IPython/html/notebookapp.py @@ -65,6 +65,7 @@ from .services.kernels.kernelmanager import MappingKernelManager from .services.notebooks.nbmanager import NotebookManager from .services.notebooks.filenbmanager import FileNotebookManager from .services.clusters.clustermanager import ClusterManager +from .services.sessions.sessionmanager import SessionManager from .base.handlers import AuthenticatedFileHandler, FileFindHandler @@ -127,18 +128,18 @@ def load_handlers(name): class NotebookWebApplication(web.Application): def __init__(self, ipython_app, kernel_manager, notebook_manager, - cluster_manager, log, + cluster_manager, session_manager, log, base_project_url, settings_overrides): settings = self.init_settings( ipython_app, kernel_manager, notebook_manager, cluster_manager, - log, base_project_url, settings_overrides) + session_manager, log, base_project_url, settings_overrides) handlers = self.init_handlers(settings) super(NotebookWebApplication, self).__init__(handlers, **settings) def init_settings(self, ipython_app, kernel_manager, notebook_manager, - cluster_manager, log, + cluster_manager, session_manager, log, base_project_url, settings_overrides): # Python < 2.6.5 doesn't accept unicode keys in f(**kwargs), and # base_project_url will always be unicode, which will in turn @@ -168,7 +169,8 @@ class NotebookWebApplication(web.Application): kernel_manager=kernel_manager, notebook_manager=notebook_manager, cluster_manager=cluster_manager, - + session_manager=session_manager, + # IPython stuff nbextensions_path = ipython_app.nbextensions_path, mathjax_url=ipython_app.mathjax_url, @@ -192,6 +194,7 @@ class NotebookWebApplication(web.Application): handlers.extend(load_handlers('services.kernels.handlers')) handlers.extend(load_handlers('services.notebooks.handlers')) handlers.extend(load_handlers('services.clusters.handlers')) + handlers.extend(load_handlers('services.sessions.handlers')) handlers.extend([ (r"/files/(.*)", AuthenticatedFileHandler, {'path' : settings['notebook_manager'].notebook_dir}), (r"/nbextensions/(.*)", FileFindHandler, {'path' : settings['nbextensions_path']}), @@ -523,7 +526,8 @@ class NotebookApp(BaseIPythonApplication): ) kls = import_item(self.notebook_manager_class) self.notebook_manager = kls(parent=self, log=self.log) - self.notebook_manager.load_notebook_names() + self.notebook_manager.load_notebook_names('') + self.session_manager = SessionManager(parent=self, log=self.log) self.cluster_manager = ClusterManager(parent=self, log=self.log) self.cluster_manager.update_profiles() @@ -540,9 +544,9 @@ class NotebookApp(BaseIPythonApplication): def init_webapp(self): """initialize tornado webapp and httpserver""" self.web_app = NotebookWebApplication( - self, self.kernel_manager, self.notebook_manager, - self.cluster_manager, self.log, - self.base_project_url, self.webapp_settings, + self, self.kernel_manager, self.notebook_manager, + self.cluster_manager, self.session_manager, self.log, + self.base_project_url, self.webapp_settings ) if self.certfile: ssl_options = dict(certfile=self.certfile)