From 91002f11197c0476a8a7c59f7abb47743b015ab8 2014-07-01 16:22:03 From: MinRK Date: 2014-07-01 16:22:03 Subject: [PATCH] set busy/idle around every message not just shell --- diff --git a/IPython/kernel/zmq/kernelbase.py b/IPython/kernel/zmq/kernelbase.py index 822768f..6c60822 100755 --- a/IPython/kernel/zmq/kernelbase.py +++ b/IPython/kernel/zmq/kernelbase.py @@ -136,7 +136,11 @@ class Kernel(Configurable): return self.log.debug("Control received: %s", msg) - + + # Set the parent message for side effects. + self.set_parent(idents, msg) + self._publish_status(u'busy') + header = msg['header'] msg_type = header['msg_type'] @@ -148,6 +152,10 @@ class Kernel(Configurable): handler(self.control_stream, idents, msg) except Exception: self.log.error("Exception in control handler:", exc_info=True) + + sys.stdout.flush() + sys.stderr.flush() + self._publish_status(u'idle') def dispatch_shell(self, stream, msg): """dispatch shell requests""" diff --git a/docs/source/development/messaging.rst b/docs/source/development/messaging.rst index 39ca444..0d31575 100644 --- a/docs/source/development/messaging.rst +++ b/docs/source/development/messaging.rst @@ -894,7 +894,7 @@ Message type: ``status``:: .. versionchanged:: 5.0 - Busy and idle messages should be sent before/after handling every shell message, + Busy and idle messages should be sent before/after handling every message, not just execution. Clear output