From 2c1b0578a4bd4b34059af7e9dee2586e309df713 2013-04-24 04:47:51 From: MinRK Date: 2013-04-24 04:47:51 Subject: [PATCH] add handle_status to qtconsole So that the qtconsole can notice that a kernel has restarted uncleanly --- diff --git a/IPython/frontend/qt/console/frontend_widget.py b/IPython/frontend/qt/console/frontend_widget.py index 41de30c..d36b628 100644 --- a/IPython/frontend/qt/console/frontend_widget.py +++ b/IPython/frontend/qt/console/frontend_widget.py @@ -541,6 +541,20 @@ class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin): if reply == QtGui.QMessageBox.Yes: self.exit_requested.emit(self) + def _handle_status(self, msg): + """Handle status message""" + # This is where a busy/idle indicator would be triggered, + # when we make one. + state = msg['content'].get('execution_state', '') + if state == 'starting': + # kernel started while we were running + if self._executing: + self._handle_kernel_restarted(died=True) + elif state == 'idle': + pass + elif state == 'busy': + pass + def _started_channels(self): """ Called when the KernelManager channels have started listening or when the frontend is assigned an already listening KernelManager.