|
@@
-66,7
+66,6
b' 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
|
from .services.sessions.sessionmanager import SessionManager
|
|
69
|
from .services.contents.contentmanager import ContentManager
|
|
|
|
|
70
|
|
|
69
|
|
|
71
|
from .base.handlers import AuthenticatedFileHandler, FileFindHandler
|
|
70
|
from .base.handlers import AuthenticatedFileHandler, FileFindHandler
|
|
72
|
|
|
71
|
|
|
@@
-129,19
+128,19
b' def load_handlers(name):'
|
|
129
|
class NotebookWebApplication(web.Application):
|
|
128
|
class NotebookWebApplication(web.Application):
|
|
130
|
|
|
129
|
|
|
131
|
def __init__(self, ipython_app, kernel_manager, notebook_manager,
|
|
130
|
def __init__(self, ipython_app, kernel_manager, notebook_manager,
|
|
132
|
cluster_manager, session_manager, content_manager, log,
|
|
131
|
cluster_manager, session_manager, log, base_project_url,
|
|
133
|
base_project_url, settings_overrides):
|
|
132
|
settings_overrides):
|
|
134
|
|
|
133
|
|
|
135
|
settings = self.init_settings(
|
|
134
|
settings = self.init_settings(
|
|
136
|
ipython_app, kernel_manager, notebook_manager, cluster_manager,
|
|
135
|
ipython_app, kernel_manager, notebook_manager, cluster_manager,
|
|
137
|
session_manager, content_manager, log, base_project_url, settings_overrides)
|
|
136
|
session_manager, log, base_project_url, settings_overrides)
|
|
138
|
handlers = self.init_handlers(settings)
|
|
137
|
handlers = self.init_handlers(settings)
|
|
139
|
|
|
138
|
|
|
140
|
super(NotebookWebApplication, self).__init__(handlers, **settings)
|
|
139
|
super(NotebookWebApplication, self).__init__(handlers, **settings)
|
|
141
|
|
|
140
|
|
|
142
|
def init_settings(self, ipython_app, kernel_manager, notebook_manager,
|
|
141
|
def init_settings(self, ipython_app, kernel_manager, notebook_manager,
|
|
143
|
cluster_manager, session_manager, content_manager, log,
|
|
142
|
cluster_manager, session_manager, log, base_project_url,
|
|
144
|
base_project_url, settings_overrides):
|
|
143
|
settings_overrides):
|
|
145
|
# 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
|
|
146
|
# base_project_url will always be unicode, which will in turn
|
|
145
|
# base_project_url will always be unicode, which will in turn
|
|
147
|
# make the patterns unicode, and ultimately result in unicode
|
|
146
|
# make the patterns unicode, and ultimately result in unicode
|
|
@@
-171,7
+170,6
b' class NotebookWebApplication(web.Application):'
|
|
171
|
notebook_manager=notebook_manager,
|
|
170
|
notebook_manager=notebook_manager,
|
|
172
|
cluster_manager=cluster_manager,
|
|
171
|
cluster_manager=cluster_manager,
|
|
173
|
session_manager=session_manager,
|
|
172
|
session_manager=session_manager,
|
|
174
|
content_manager=content_manager,
|
|
|
|
|
175
|
|
|
173
|
|
|
176
|
# IPython stuff
|
|
174
|
# IPython stuff
|
|
177
|
nbextensions_path = ipython_app.nbextensions_path,
|
|
175
|
nbextensions_path = ipython_app.nbextensions_path,
|
|
@@
-197,7
+195,6
b' class NotebookWebApplication(web.Application):'
|
|
197
|
handlers.extend(load_handlers('services.notebooks.handlers'))
|
|
195
|
handlers.extend(load_handlers('services.notebooks.handlers'))
|
|
198
|
handlers.extend(load_handlers('services.clusters.handlers'))
|
|
196
|
handlers.extend(load_handlers('services.clusters.handlers'))
|
|
199
|
handlers.extend(load_handlers('services.sessions.handlers'))
|
|
197
|
handlers.extend(load_handlers('services.sessions.handlers'))
|
|
200
|
handlers.extend(load_handlers('services.contents.handlers'))
|
|
|
|
|
201
|
handlers.extend([
|
|
198
|
handlers.extend([
|
|
202
|
(r"/files/(.*)", AuthenticatedFileHandler, {'path' : settings['notebook_manager'].notebook_dir}),
|
|
199
|
(r"/files/(.*)", AuthenticatedFileHandler, {'path' : settings['notebook_manager'].notebook_dir}),
|
|
203
|
(r"/nbextensions/(.*)", FileFindHandler, {'path' : settings['nbextensions_path']}),
|
|
200
|
(r"/nbextensions/(.*)", FileFindHandler, {'path' : settings['nbextensions_path']}),
|
|
@@
-534,7
+531,6
b' class NotebookApp(BaseIPythonApplication):'
|
|
534
|
self.notebook_manager = kls(parent=self, log=self.log)
|
|
531
|
self.notebook_manager = kls(parent=self, log=self.log)
|
|
535
|
self.notebook_manager.load_notebook_names('')
|
|
532
|
self.notebook_manager.load_notebook_names('')
|
|
536
|
self.session_manager = SessionManager(parent=self, log=self.log)
|
|
533
|
self.session_manager = SessionManager(parent=self, log=self.log)
|
|
537
|
self.content_manager = ContentManager(parent=self, log=self.log)
|
|
|
|
|
538
|
self.cluster_manager = ClusterManager(parent=self, log=self.log)
|
|
534
|
self.cluster_manager = ClusterManager(parent=self, log=self.log)
|
|
539
|
self.cluster_manager.update_profiles()
|
|
535
|
self.cluster_manager.update_profiles()
|
|
540
|
|
|
536
|
|
|
@@
-552,7
+548,7
b' class NotebookApp(BaseIPythonApplication):'
|
|
552
|
"""initialize tornado webapp and httpserver"""
|
|
548
|
"""initialize tornado webapp and httpserver"""
|
|
553
|
self.web_app = NotebookWebApplication(
|
|
549
|
self.web_app = NotebookWebApplication(
|
|
554
|
self, self.kernel_manager, self.notebook_manager,
|
|
550
|
self, self.kernel_manager, self.notebook_manager,
|
|
555
|
self.cluster_manager, self.session_manager, self.content_manager,
|
|
551
|
self.cluster_manager, self.session_manager,
|
|
556
|
self.log, self.base_project_url, self.webapp_settings
|
|
552
|
self.log, self.base_project_url, self.webapp_settings
|
|
557
|
)
|
|
553
|
)
|
|
558
|
if self.certfile:
|
|
554
|
if self.certfile:
|