Show More
@@ -85,7 +85,7 b' from IPython.utils.traitlets import (' | |||||
85 | DottedObjectName |
|
85 | DottedObjectName | |
86 | ) |
|
86 | ) | |
87 | from IPython.utils import py3compat |
|
87 | from IPython.utils import py3compat | |
88 | from IPython.utils.path import filefind |
|
88 | from IPython.utils.path import filefind, get_ipython_dir | |
89 |
|
89 | |||
90 | from .utils import url_path_join |
|
90 | from .utils import url_path_join | |
91 |
|
91 | |||
@@ -170,6 +170,7 b' class NotebookWebApplication(web.Application):' | |||||
170 | cluster_manager=cluster_manager, |
|
170 | cluster_manager=cluster_manager, | |
171 |
|
171 | |||
172 | # IPython stuff |
|
172 | # IPython stuff | |
|
173 | js_extensions_path = ipython_app.js_extensions_path, | |||
173 | mathjax_url=ipython_app.mathjax_url, |
|
174 | mathjax_url=ipython_app.mathjax_url, | |
174 | config=ipython_app.config, |
|
175 | config=ipython_app.config, | |
175 | use_less=ipython_app.use_less, |
|
176 | use_less=ipython_app.use_less, | |
@@ -193,6 +194,7 b' class NotebookWebApplication(web.Application):' | |||||
193 | handlers.extend(load_handlers('services.clusters.handlers')) |
|
194 | handlers.extend(load_handlers('services.clusters.handlers')) | |
194 | handlers.extend([ |
|
195 | handlers.extend([ | |
195 | (r"/files/(.*)", AuthenticatedFileHandler, {'path' : settings['notebook_manager'].notebook_dir}), |
|
196 | (r"/files/(.*)", AuthenticatedFileHandler, {'path' : settings['notebook_manager'].notebook_dir}), | |
|
197 | (r"/js_extensions/(.*)", FileFindHandler, {'path' : settings['js_extensions_path']}), | |||
196 | ]) |
|
198 | ]) | |
197 | # prepend base_project_url onto the patterns that we match |
|
199 | # prepend base_project_url onto the patterns that we match | |
198 | new_handlers = [] |
|
200 | new_handlers = [] | |
@@ -432,6 +434,12 b' class NotebookApp(BaseIPythonApplication):' | |||||
432 | def static_file_path(self): |
|
434 | def static_file_path(self): | |
433 | """return extra paths + the default location""" |
|
435 | """return extra paths + the default location""" | |
434 | return self.extra_static_paths + [DEFAULT_STATIC_FILES_PATH] |
|
436 | return self.extra_static_paths + [DEFAULT_STATIC_FILES_PATH] | |
|
437 | ||||
|
438 | js_extensions_path = List(Unicode, config=True, | |||
|
439 | help="""paths for Javascript extensions. By default, this is just IPYTHONDIR/js_extensions""" | |||
|
440 | ) | |||
|
441 | def _js_extensions_path_default(self): | |||
|
442 | return [os.path.join(get_ipython_dir(), 'js_extensions')] | |||
435 |
|
443 | |||
436 | mathjax_url = Unicode("", config=True, |
|
444 | mathjax_url = Unicode("", config=True, | |
437 | help="""The url for MathJax.js.""" |
|
445 | help="""The url for MathJax.js.""" | |
@@ -521,9 +529,9 b' class NotebookApp(BaseIPythonApplication):' | |||||
521 | def init_webapp(self): |
|
529 | def init_webapp(self): | |
522 | """initialize tornado webapp and httpserver""" |
|
530 | """initialize tornado webapp and httpserver""" | |
523 | self.web_app = NotebookWebApplication( |
|
531 | self.web_app = NotebookWebApplication( | |
524 |
self, self.kernel_manager, self.notebook_manager, |
|
532 | self, self.kernel_manager, self.notebook_manager, | |
525 | self.cluster_manager, self.log, |
|
533 | self.cluster_manager, self.log, | |
526 | self.base_project_url, self.webapp_settings |
|
534 | self.base_project_url, self.webapp_settings, | |
527 | ) |
|
535 | ) | |
528 | if self.certfile: |
|
536 | if self.certfile: | |
529 | ssl_options = dict(certfile=self.certfile) |
|
537 | ssl_options = dict(certfile=self.certfile) |
General Comments 0
You need to be logged in to leave comments.
Login now