Show More
@@ -263,8 +263,12 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||||
263 | hook.finish_displayhook() |
|
263 | hook.finish_displayhook() | |
264 |
|
264 | |||
265 | elif msg_type == 'display_data': |
|
265 | elif msg_type == 'display_data': | |
266 |
|
|
266 | data = sub_msg["content"]["data"] | |
267 |
|
267 | handled = self.handle_rich_data(data) | ||
|
268 | if not handled: | |||
|
269 | # if it was an image, we handled it by now | |||
|
270 | if 'text/plain' in data: | |||
|
271 | print(data['text/plain']) | |||
268 |
|
272 | |||
269 | _imagemime = { |
|
273 | _imagemime = { | |
270 | 'image/png': 'png', |
|
274 | 'image/png': 'png', | |
@@ -276,10 +280,7 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||||
276 | for mime in self.mime_preference: |
|
280 | for mime in self.mime_preference: | |
277 | if mime in data and mime in self._imagemime: |
|
281 | if mime in data and mime in self._imagemime: | |
278 | self.handle_image(data, mime) |
|
282 | self.handle_image(data, mime) | |
279 | return |
|
283 | return True | |
280 | # if it was an image, we handled it by now and returned |
|
|||
281 | if 'text/plain' in data: |
|
|||
282 | print(data['text/plain']) |
|
|||
283 |
|
284 | |||
284 | def handle_image(self, data, mime): |
|
285 | def handle_image(self, data, mime): | |
285 | handler = getattr( |
|
286 | handler = getattr( |
General Comments 0
You need to be logged in to leave comments.
Login now