Show More
@@ -25,6 +25,7 b' class BaseFrontendMixin(object):' | |||||
25 | # Disconnect the old kernel manager, if necessary. |
|
25 | # Disconnect the old kernel manager, if necessary. | |
26 | old_manager = self._kernel_manager |
|
26 | old_manager = self._kernel_manager | |
27 | if old_manager is not None: |
|
27 | if old_manager is not None: | |
|
28 | old_manager.started_kernel.disconnect(self._started_kernel) | |||
28 | old_manager.started_channels.disconnect(self._started_channels) |
|
29 | old_manager.started_channels.disconnect(self._started_channels) | |
29 | old_manager.stopped_channels.disconnect(self._stopped_channels) |
|
30 | old_manager.stopped_channels.disconnect(self._stopped_channels) | |
30 |
|
31 | |||
@@ -45,6 +46,7 b' class BaseFrontendMixin(object):' | |||||
45 | return |
|
46 | return | |
46 |
|
47 | |||
47 | # Connect the new kernel manager. |
|
48 | # Connect the new kernel manager. | |
|
49 | kernel_manager.started_kernel.connect(self._started_kernel) | |||
48 | kernel_manager.started_channels.connect(self._started_channels) |
|
50 | kernel_manager.started_channels.connect(self._started_channels) | |
49 | kernel_manager.stopped_channels.connect(self._stopped_channels) |
|
51 | kernel_manager.stopped_channels.connect(self._stopped_channels) | |
50 |
|
52 | |||
@@ -78,6 +80,11 b' class BaseFrontendMixin(object):' | |||||
78 | The time since the heartbeat was last received. |
|
80 | The time since the heartbeat was last received. | |
79 | """ |
|
81 | """ | |
80 |
|
82 | |||
|
83 | def _started_kernel(self): | |||
|
84 | """Called when the KernelManager starts (or restarts) the kernel subprocess. | |||
|
85 | Channels may or may not be running at this point. | |||
|
86 | """ | |||
|
87 | ||||
81 | def _started_channels(self): |
|
88 | def _started_channels(self): | |
82 | """ Called when the KernelManager channels have started listening or |
|
89 | """ Called when the KernelManager channels have started listening or | |
83 | when the frontend is assigned an already listening KernelManager. |
|
90 | when the frontend is assigned an already listening KernelManager. |
@@ -183,6 +183,9 b' class QtKernelManager(KernelManager, SuperQObject):' | |||||
183 | __metaclass__ = MetaQObjectHasTraits |
|
183 | __metaclass__ = MetaQObjectHasTraits | |
184 |
|
184 | |||
185 | # Emitted when the kernel manager has started listening. |
|
185 | # Emitted when the kernel manager has started listening. | |
|
186 | started_kernel = QtCore.Signal() | |||
|
187 | ||||
|
188 | # Emitted when the kernel manager has started listening. | |||
186 | started_channels = QtCore.Signal() |
|
189 | started_channels = QtCore.Signal() | |
187 |
|
190 | |||
188 | # Emitted when the kernel manager has stopped listening. |
|
191 | # Emitted when the kernel manager has stopped listening. | |
@@ -206,6 +209,7 b' class QtKernelManager(KernelManager, SuperQObject):' | |||||
206 | if self._shell_channel is not None: |
|
209 | if self._shell_channel is not None: | |
207 | self._shell_channel.reset_first_reply() |
|
210 | self._shell_channel.reset_first_reply() | |
208 | super(QtKernelManager, self).start_kernel(*args, **kw) |
|
211 | super(QtKernelManager, self).start_kernel(*args, **kw) | |
|
212 | self.started_kernel.emit() | |||
209 |
|
213 | |||
210 | #------ Channel management ------------------------------------------------- |
|
214 | #------ Channel management ------------------------------------------------- | |
211 |
|
215 |
General Comments 0
You need to be logged in to leave comments.
Login now