##// END OF EJS Templates
fix bug in stale profile clean up for clusters...
fix bug in stale profile clean up for clusters "clusters" tab of my notebook wasn't rendering, so checked the log, found the stack trace: ``` [...] File "/usr/local/lib/python3.4/site-packages/ipython-3.0.0-py3.4.egg/IPython/html/services/clusters/handlers.py", line 21, in get self.finish(json.dumps(self.cluster_manager.list_profiles())) File "/usr/local/lib/python3.4/site-packages/ipython-3.0.0-py3.4.egg/IPython/html/services/clusters/clustermanager.py", line 77, in list_profiles self.update_profiles() File "/usr/local/lib/python3.4/site-packages/ipython-3.0.0-py3.4.egg/IPython/html/services/clusters/clustermanager.py", line 74, in update_profiles self.profiles.pop(stale) TypeError: unhashable type: 'set' ``` looks like a pretty straightforward mistake

File last commit:

r21212:244bf603
r21236:10a376e0
Show More
__init__.py
26 lines | 1.0 KiB | text/x-python | PythonLexer
Thomas Kluyver
Multiple terminals and conditional initialisation
r18482 import os
Min RK
require terminado >= 0.3.3 for terminal handlers
r19980
import terminado
Min RK
avoid utils.version dependency in split repos
r21175 from ..utils import check_version
Min RK
require terminado >= 0.3.3 for terminal handlers
r19980
if not check_version(terminado.__version__, '0.3.3'):
raise ImportError("terminado >= 0.3.3 required, found %s" % terminado.__version__)
Thomas Kluyver
Multiple terminals and conditional initialisation
r18482 from terminado import NamedTermManager
Min RK
hook up terminado logger
r19974 from tornado.log import app_log
Min RK
jupyter_notebook imports
r21212 from jupyter_notebook.utils import url_path_join as ujoin
Min RK
create new terminals with POST /api/terminals...
r18616 from .handlers import TerminalHandler, 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')
Min RK
create new terminals with POST /api/terminals...
r18616 terminal_manager = webapp.settings['terminal_manager'] = NamedTermManager(shell_command=[shell])
Min RK
hook up terminado logger
r19974 terminal_manager.log = app_log
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, r"/terminals/(\w+)"), TerminalHandler),
(ujoin(base_url, r"/terminals/websocket/(\w+)"), TermSocket,
Min RK
create new terminals with POST /api/terminals...
r18616 {'term_manager': 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)