##// END OF EJS Templates
Fixing small bug in display logic....
Brian Granger -
Show More
1 NO CONTENT: modified file
NO CONTENT: modified file
@@ -48,6 +48,12 b' install_payload_page()'
48 # Functions and classes
48 # Functions and classes
49 #-----------------------------------------------------------------------------
49 #-----------------------------------------------------------------------------
50
50
51 def _encode_png(data):
52 pngdata = data.get('image/png')
53 if pngdata is not None:
54 data['image/png'] = encodestring(pngdata)
55
56
51 class ZMQDisplayHook(DisplayHook):
57 class ZMQDisplayHook(DisplayHook):
52 """A displayhook subclass that publishes data using ZeroMQ."""
58 """A displayhook subclass that publishes data using ZeroMQ."""
53
59
@@ -69,8 +75,7 b' class ZMQDisplayHook(DisplayHook):'
69
75
70 def write_format_data(self, format_dict):
76 def write_format_data(self, format_dict):
71 pngdata = format_dict.get('image/png')
77 pngdata = format_dict.get('image/png')
72 if pngdata is not None:
78 _encode_png(format_dict)
73 format_dict['image/png'] = encodestring(pngdata)
74 self.msg['content']['data'] = format_dict
79 self.msg['content']['data'] = format_dict
75
80
76 def finish_displayhook(self):
81 def finish_displayhook(self):
@@ -96,6 +101,7 b' class ZMQDisplayPublisher(DisplayPublisher):'
96 self._validate_data(source, data, metadata)
101 self._validate_data(source, data, metadata)
97 content = {}
102 content = {}
98 content['source'] = source
103 content['source'] = source
104 _encode_png(data)
99 content['data'] = data
105 content['data'] = data
100 content['metadata'] = metadata
106 content['metadata'] = metadata
101 self.session.send(
107 self.session.send(
General Comments 0
You need to be logged in to leave comments. Login now