##// END OF EJS Templates
load kernel js, css, logo on spec_changed event...
load kernel js, css, logo on spec_changed event Ensures kernel.js is always loaded. It wasn't being loaded when creating a new notebook with a particular kernel because `change_kernel` wasn't being called. Only the `spec_changed` event is triggered by all the various ways a kernel can be loaded, so load kernel stuff on that event.

File last commit:

r18616:d4e327ea
r19745:bff10f31
Show More
__init__.py
17 lines | 800 B | text/x-python | PythonLexer
import os
from terminado import NamedTermManager
from IPython.html.utils import url_path_join as ujoin
from .handlers import TerminalHandler, TermSocket
from . import api_handlers
def initialize(webapp):
shell = os.environ.get('SHELL', 'sh')
terminal_manager = webapp.settings['terminal_manager'] = NamedTermManager(shell_command=[shell])
base_url = webapp.settings['base_url']
handlers = [
(ujoin(base_url, r"/terminals/(\w+)"), TerminalHandler),
(ujoin(base_url, r"/terminals/websocket/(\w+)"), TermSocket,
{'term_manager': terminal_manager}),
(ujoin(base_url, r"/api/terminals"), api_handlers.TerminalRootHandler),
(ujoin(base_url, r"/api/terminals/(\w+)"), api_handlers.TerminalHandler),
]
webapp.add_handlers(".*$", handlers)