Show More
@@ -59,8 +59,14 b' class ZMQDisplayPublisher(DisplayPublisher):' | |||||
59 | def set_parent(self, parent): |
|
59 | def set_parent(self, parent): | |
60 | """Set the parent for outbound messages.""" |
|
60 | """Set the parent for outbound messages.""" | |
61 | self.parent_header = extract_header(parent) |
|
61 | self.parent_header = extract_header(parent) | |
|
62 | ||||
|
63 | def _flush_streams(self): | |||
|
64 | """flush IO Streams prior to display""" | |||
|
65 | sys.stdout.flush() | |||
|
66 | sys.stderr.flush() | |||
62 |
|
67 | |||
63 | def publish(self, source, data, metadata=None): |
|
68 | def publish(self, source, data, metadata=None): | |
|
69 | self._flush_streams() | |||
64 | if metadata is None: |
|
70 | if metadata is None: | |
65 | metadata = {} |
|
71 | metadata = {} | |
66 | self._validate_data(source, data, metadata) |
|
72 | self._validate_data(source, data, metadata) | |
@@ -75,6 +81,7 b' class ZMQDisplayPublisher(DisplayPublisher):' | |||||
75 | ) |
|
81 | ) | |
76 |
|
82 | |||
77 | def clear_output(self, stdout=True, stderr=True, other=True): |
|
83 | def clear_output(self, stdout=True, stderr=True, other=True): | |
|
84 | self._flush_streams() | |||
78 | content = dict(stdout=stdout, stderr=stderr, other=other) |
|
85 | content = dict(stdout=stdout, stderr=stderr, other=other) | |
79 | self.session.send( |
|
86 | self.session.send( | |
80 | self.pub_socket, u'clear_output', content, |
|
87 | self.pub_socket, u'clear_output', content, |
General Comments 0
You need to be logged in to leave comments.
Login now