Show More
@@ -173,7 +173,13 b' class ZMQStreamHandler(websocket.WebSocketHandler):' | |||||
173 | class AuthenticatedZMQStreamHandler(ZMQStreamHandler): |
|
173 | class AuthenticatedZMQStreamHandler(ZMQStreamHandler): | |
174 | def open(self, kernel_id): |
|
174 | def open(self, kernel_id): | |
175 | self.kernel_id = kernel_id.decode('ascii') |
|
175 | self.kernel_id = kernel_id.decode('ascii') | |
176 | self.session = Session() |
|
176 | try: | |
|
177 | cfg = self.application.ipython_app.config | |||
|
178 | except AttributeError: | |||
|
179 | # protect from the case where this is run from something other than | |||
|
180 | # the notebook app: | |||
|
181 | cfg = None | |||
|
182 | self.session = Session(config=cfg) | |||
177 | self.save_on_message = self.on_message |
|
183 | self.save_on_message = self.on_message | |
178 | self.on_message = self.on_first_message |
|
184 | self.on_message = self.on_first_message | |
179 |
|
185 |
@@ -70,7 +70,8 b' class MultiKernelManager(LoggingConfigurable):' | |||||
70 | kernel_id = unicode(uuid.uuid4()) |
|
70 | kernel_id = unicode(uuid.uuid4()) | |
71 | # use base KernelManager for each Kernel |
|
71 | # use base KernelManager for each Kernel | |
72 | km = KernelManager(connection_file=os.path.join( |
|
72 | km = KernelManager(connection_file=os.path.join( | |
73 | self.connection_dir, "kernel-%s.json" % kernel_id) |
|
73 | self.connection_dir, "kernel-%s.json" % kernel_id), | |
|
74 | config=self.config, | |||
74 | ) |
|
75 | ) | |
75 | km.start_kernel(**kwargs) |
|
76 | km.start_kernel(**kwargs) | |
76 | self._kernels[kernel_id] = km |
|
77 | self._kernels[kernel_id] = km |
@@ -44,7 +44,7 b' from .notebookmanager import NotebookManager' | |||||
44 |
|
44 | |||
45 | from IPython.core.application import BaseIPythonApplication |
|
45 | from IPython.core.application import BaseIPythonApplication | |
46 | from IPython.core.profiledir import ProfileDir |
|
46 | from IPython.core.profiledir import ProfileDir | |
47 | from IPython.zmq.session import Session |
|
47 | from IPython.zmq.session import Session, default_secure | |
48 | from IPython.zmq.zmqshell import ZMQInteractiveShell |
|
48 | from IPython.zmq.zmqshell import ZMQInteractiveShell | |
49 | from IPython.zmq.ipkernel import ( |
|
49 | from IPython.zmq.ipkernel import ( | |
50 | flags as ipkernel_flags, |
|
50 | flags as ipkernel_flags, | |
@@ -128,6 +128,10 b' aliases.update({' | |||||
128 | 'notebook-dir': 'NotebookManager.notebook_dir', |
|
128 | 'notebook-dir': 'NotebookManager.notebook_dir', | |
129 | }) |
|
129 | }) | |
130 |
|
130 | |||
|
131 | # remove ipkernel flags that are singletons, and don't make sense in | |||
|
132 | # multi-kernel evironment: | |||
|
133 | aliases.pop('f', None) | |||
|
134 | ||||
131 | notebook_aliases = [u'port', u'ip', u'keyfile', u'certfile', u'ws-hostname', |
|
135 | notebook_aliases = [u'port', u'ip', u'keyfile', u'certfile', u'ws-hostname', | |
132 | u'notebook-dir'] |
|
136 | u'notebook-dir'] | |
133 |
|
137 | |||
@@ -231,6 +235,8 b' class IPythonNotebookApp(BaseIPythonApplication):' | |||||
231 | # Don't let Qt or ZMQ swallow KeyboardInterupts. |
|
235 | # Don't let Qt or ZMQ swallow KeyboardInterupts. | |
232 | signal.signal(signal.SIGINT, signal.SIG_DFL) |
|
236 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
233 |
|
237 | |||
|
238 | # force Session default to be secure | |||
|
239 | default_secure(self.config) | |||
234 | # Create a KernelManager and start a kernel. |
|
240 | # Create a KernelManager and start a kernel. | |
235 | self.kernel_manager = MappingKernelManager( |
|
241 | self.kernel_manager = MappingKernelManager( | |
236 | config=self.config, log=self.log, kernel_argv=self.kernel_argv, |
|
242 | config=self.config, log=self.log, kernel_argv=self.kernel_argv, |
General Comments 0
You need to be logged in to leave comments.
Login now