##// END OF EJS Templates
manual rebase notebookapp.py
Zachary Sailer -
Show More
@@ -65,6 +65,7 b' from .services.kernels.kernelmanager import MappingKernelManager'
65 from .services.notebooks.nbmanager import NotebookManager
65 from .services.notebooks.nbmanager import NotebookManager
66 from .services.notebooks.filenbmanager import FileNotebookManager
66 from .services.notebooks.filenbmanager import FileNotebookManager
67 from .services.clusters.clustermanager import ClusterManager
67 from .services.clusters.clustermanager import ClusterManager
68 from .services.sessions.sessionmanager import SessionManager
68
69
69 from .base.handlers import AuthenticatedFileHandler, FileFindHandler
70 from .base.handlers import AuthenticatedFileHandler, FileFindHandler
70
71
@@ -127,18 +128,18 b' def load_handlers(name):'
127 class NotebookWebApplication(web.Application):
128 class NotebookWebApplication(web.Application):
128
129
129 def __init__(self, ipython_app, kernel_manager, notebook_manager,
130 def __init__(self, ipython_app, kernel_manager, notebook_manager,
130 cluster_manager, log,
131 cluster_manager, session_manager, log,
131 base_project_url, settings_overrides):
132 base_project_url, settings_overrides):
132
133
133 settings = self.init_settings(
134 settings = self.init_settings(
134 ipython_app, kernel_manager, notebook_manager, cluster_manager,
135 ipython_app, kernel_manager, notebook_manager, cluster_manager,
135 log, base_project_url, settings_overrides)
136 session_manager, log, base_project_url, settings_overrides)
136 handlers = self.init_handlers(settings)
137 handlers = self.init_handlers(settings)
137
138
138 super(NotebookWebApplication, self).__init__(handlers, **settings)
139 super(NotebookWebApplication, self).__init__(handlers, **settings)
139
140
140 def init_settings(self, ipython_app, kernel_manager, notebook_manager,
141 def init_settings(self, ipython_app, kernel_manager, notebook_manager,
141 cluster_manager, log,
142 cluster_manager, session_manager, log,
142 base_project_url, settings_overrides):
143 base_project_url, settings_overrides):
143 # Python < 2.6.5 doesn't accept unicode keys in f(**kwargs), and
144 # Python < 2.6.5 doesn't accept unicode keys in f(**kwargs), and
144 # base_project_url will always be unicode, which will in turn
145 # base_project_url will always be unicode, which will in turn
@@ -168,7 +169,8 b' class NotebookWebApplication(web.Application):'
168 kernel_manager=kernel_manager,
169 kernel_manager=kernel_manager,
169 notebook_manager=notebook_manager,
170 notebook_manager=notebook_manager,
170 cluster_manager=cluster_manager,
171 cluster_manager=cluster_manager,
171
172 session_manager=session_manager,
173
172 # IPython stuff
174 # IPython stuff
173 nbextensions_path = ipython_app.nbextensions_path,
175 nbextensions_path = ipython_app.nbextensions_path,
174 mathjax_url=ipython_app.mathjax_url,
176 mathjax_url=ipython_app.mathjax_url,
@@ -192,6 +194,7 b' class NotebookWebApplication(web.Application):'
192 handlers.extend(load_handlers('services.kernels.handlers'))
194 handlers.extend(load_handlers('services.kernels.handlers'))
193 handlers.extend(load_handlers('services.notebooks.handlers'))
195 handlers.extend(load_handlers('services.notebooks.handlers'))
194 handlers.extend(load_handlers('services.clusters.handlers'))
196 handlers.extend(load_handlers('services.clusters.handlers'))
197 handlers.extend(load_handlers('services.sessions.handlers'))
195 handlers.extend([
198 handlers.extend([
196 (r"/files/(.*)", AuthenticatedFileHandler, {'path' : settings['notebook_manager'].notebook_dir}),
199 (r"/files/(.*)", AuthenticatedFileHandler, {'path' : settings['notebook_manager'].notebook_dir}),
197 (r"/nbextensions/(.*)", FileFindHandler, {'path' : settings['nbextensions_path']}),
200 (r"/nbextensions/(.*)", FileFindHandler, {'path' : settings['nbextensions_path']}),
@@ -523,7 +526,8 b' class NotebookApp(BaseIPythonApplication):'
523 )
526 )
524 kls = import_item(self.notebook_manager_class)
527 kls = import_item(self.notebook_manager_class)
525 self.notebook_manager = kls(parent=self, log=self.log)
528 self.notebook_manager = kls(parent=self, log=self.log)
526 self.notebook_manager.load_notebook_names()
529 self.notebook_manager.load_notebook_names('')
530 self.session_manager = SessionManager(parent=self, log=self.log)
527 self.cluster_manager = ClusterManager(parent=self, log=self.log)
531 self.cluster_manager = ClusterManager(parent=self, log=self.log)
528 self.cluster_manager.update_profiles()
532 self.cluster_manager.update_profiles()
529
533
@@ -540,9 +544,9 b' class NotebookApp(BaseIPythonApplication):'
540 def init_webapp(self):
544 def init_webapp(self):
541 """initialize tornado webapp and httpserver"""
545 """initialize tornado webapp and httpserver"""
542 self.web_app = NotebookWebApplication(
546 self.web_app = NotebookWebApplication(
543 self, self.kernel_manager, self.notebook_manager,
547 self, self.kernel_manager, self.notebook_manager,
544 self.cluster_manager, self.log,
548 self.cluster_manager, self.session_manager, self.log,
545 self.base_project_url, self.webapp_settings,
549 self.base_project_url, self.webapp_settings
546 )
550 )
547 if self.certfile:
551 if self.certfile:
548 ssl_options = dict(certfile=self.certfile)
552 ssl_options = dict(certfile=self.certfile)
General Comments 0
You need to be logged in to leave comments. Login now