##// END OF EJS Templates
add data_pub messages...
MinRK -
Show More
@@ -270,6 +270,7 b' class InteractiveShell(SingletonConfigurable):'
270 display_formatter = Instance(DisplayFormatter)
270 display_formatter = Instance(DisplayFormatter)
271 displayhook_class = Type(DisplayHook)
271 displayhook_class = Type(DisplayHook)
272 display_pub_class = Type(DisplayPublisher)
272 display_pub_class = Type(DisplayPublisher)
273 data_pub_class = None
273
274
274 exit_now = CBool(False)
275 exit_now = CBool(False)
275 exiter = Instance(ExitAutocall)
276 exiter = Instance(ExitAutocall)
@@ -483,6 +484,7 b' class InteractiveShell(SingletonConfigurable):'
483 self.init_prompts()
484 self.init_prompts()
484 self.init_display_formatter()
485 self.init_display_formatter()
485 self.init_display_pub()
486 self.init_display_pub()
487 self.init_data_pub()
486 self.init_displayhook()
488 self.init_displayhook()
487 self.init_reload_doctest()
489 self.init_reload_doctest()
488 self.init_latextool()
490 self.init_latextool()
@@ -659,6 +661,13 b' class InteractiveShell(SingletonConfigurable):'
659 self.display_pub = self.display_pub_class(config=self.config)
661 self.display_pub = self.display_pub_class(config=self.config)
660 self.configurables.append(self.display_pub)
662 self.configurables.append(self.display_pub)
661
663
664 def init_data_pub(self):
665 if not self.data_pub_class:
666 self.data_pub = None
667 return
668 self.data_pub = self.data_pub_class(config=self.config)
669 self.configurables.append(self.data_pub)
670
662 def init_displayhook(self):
671 def init_displayhook(self):
663 # Initialize displayhook, set in/out prompts and printing system
672 # Initialize displayhook, set in/out prompts and printing system
664 self.displayhook = self.displayhook_class(
673 self.displayhook = self.displayhook_class(
@@ -147,6 +147,8 b' class Kernel(Configurable):'
147 self.shell.displayhook.topic = self._topic('pyout')
147 self.shell.displayhook.topic = self._topic('pyout')
148 self.shell.display_pub.session = self.session
148 self.shell.display_pub.session = self.session
149 self.shell.display_pub.pub_socket = self.iopub_socket
149 self.shell.display_pub.pub_socket = self.iopub_socket
150 self.shell.data_pub.session = self.session
151 self.shell.data_pub.pub_socket = self.iopub_socket
150
152
151 # TMP - hack while developing
153 # TMP - hack while developing
152 self.shell._reply_content = None
154 self.shell._reply_content = None
@@ -353,6 +355,7 b' class Kernel(Configurable):'
353 # Set the parent message of the display hook and out streams.
355 # Set the parent message of the display hook and out streams.
354 shell.displayhook.set_parent(parent)
356 shell.displayhook.set_parent(parent)
355 shell.display_pub.set_parent(parent)
357 shell.display_pub.set_parent(parent)
358 shell.data_pub.set_parent(parent)
356 sys.stdout.set_parent(parent)
359 sys.stdout.set_parent(parent)
357 sys.stderr.set_parent(parent)
360 sys.stderr.set_parent(parent)
358
361
@@ -538,6 +541,7 b' class Kernel(Configurable):'
538 shell = self.shell
541 shell = self.shell
539 shell.displayhook.set_parent(parent)
542 shell.displayhook.set_parent(parent)
540 shell.display_pub.set_parent(parent)
543 shell.display_pub.set_parent(parent)
544 shell.data_pub.set_parent(parent)
541 sys.stdout.set_parent(parent)
545 sys.stdout.set_parent(parent)
542 sys.stderr.set_parent(parent)
546 sys.stderr.set_parent(parent)
543
547
@@ -44,6 +44,7 b' from IPython.utils import py3compat'
44 from IPython.utils.traitlets import Instance, Type, Dict, CBool, CBytes
44 from IPython.utils.traitlets import Instance, Type, Dict, CBool, CBytes
45 from IPython.utils.warn import warn, error
45 from IPython.utils.warn import warn, error
46 from IPython.zmq.displayhook import ZMQShellDisplayHook
46 from IPython.zmq.displayhook import ZMQShellDisplayHook
47 from IPython.zmq.datapub import ZMQDataPublisher
47 from IPython.zmq.session import extract_header
48 from IPython.zmq.session import extract_header
48 from session import Session
49 from session import Session
49
50
@@ -464,6 +465,7 b' class ZMQInteractiveShell(InteractiveShell):'
464
465
465 displayhook_class = Type(ZMQShellDisplayHook)
466 displayhook_class = Type(ZMQShellDisplayHook)
466 display_pub_class = Type(ZMQDisplayPublisher)
467 display_pub_class = Type(ZMQDisplayPublisher)
468 data_pub_class = Type(ZMQDataPublisher)
467
469
468 # Override the traitlet in the parent class, because there's no point using
470 # Override the traitlet in the parent class, because there's no point using
469 # readline for the kernel. Can be removed when the readline code is moved
471 # readline for the kernel. Can be removed when the readline code is moved
General Comments 0
You need to be logged in to leave comments. Login now