##// END OF EJS Templates
Adds configuration options to use Google Drive content manager...
Adds configuration options to use Google Drive content manager Adds the key contentmanager_js_source to webapp_settings that allows for specifying the content manager JavaScript source file. Also adds a NotebookManager subclass, ClientSideNotebookManager, which does minimal logic. This class is used when the JavaScript content manager doesn't use the Python notebook manager, but rather implements that logic client side, as is the case for the Google Drive based content manager. A sample command line that uses the Google Drive content manager, and the ClientSideNotebookManager, is ipython notebook --NotebookApp.webapp_settings="{'contentmanager_js_source': 'base/js/drive_contentmanager'}" --NotebookApp.notebook_manager_class="IPython.html.services.notebooks.clientsidenbmanager.ClientSideNotebookManager"

File last commit:

r18485:8ddd2960
r18639:28c27a69
Show More
__init__.py
18 lines | 861 B | text/x-python | PythonLexer
Thomas Kluyver
Multiple terminals and conditional initialisation
r18482 import os
from terminado import NamedTermManager
Thomas Kluyver
Put terminal handlers under base_url
r18485 from IPython.html.utils import url_path_join as ujoin
Thomas Kluyver
Multiple terminals and conditional initialisation
r18482 from .handlers import TerminalHandler, NewTerminalHandler, TermSocket
Thomas Kluyver
Initial REST API for terminals
r18483 from . import api_handlers
Thomas Kluyver
Multiple terminals and conditional initialisation
r18482
def initialize(webapp):
shell = os.environ.get('SHELL', 'sh')
webapp.terminal_manager = NamedTermManager(shell_command=[shell])
Thomas Kluyver
Put terminal handlers under base_url
r18485 base_url = webapp.settings['base_url']
Thomas Kluyver
Multiple terminals and conditional initialisation
r18482 handlers = [
Thomas Kluyver
Put terminal handlers under base_url
r18485 (ujoin(base_url, "/terminals/new"), NewTerminalHandler),
(ujoin(base_url, r"/terminals/(\w+)"), TerminalHandler),
(ujoin(base_url, r"/terminals/websocket/(\w+)"), TermSocket,
Thomas Kluyver
Multiple terminals and conditional initialisation
r18482 {'term_manager': webapp.terminal_manager}),
Thomas Kluyver
Put terminal handlers under base_url
r18485 (ujoin(base_url, r"/api/terminals"), api_handlers.TerminalRootHandler),
(ujoin(base_url, r"/api/terminals/(\w+)"), api_handlers.TerminalHandler),
Thomas Kluyver
Multiple terminals and conditional initialisation
r18482 ]
webapp.add_handlers(".*$", handlers)