##// END OF EJS Templates
Added display hook logic to handle widgets
Jonathan Frederic -
Show More
@@ -24,6 +24,7 b' import struct'
24
24
25 from IPython.utils.py3compat import (string_types, cast_bytes_py2, cast_unicode,
25 from IPython.utils.py3compat import (string_types, cast_bytes_py2, cast_unicode,
26 unicode_type)
26 unicode_type)
27 from IPython.html.widgets import Widget
27
28
28 from .displaypub import publish_display_data
29 from .displaypub import publish_display_data
29
30
@@ -110,6 +111,9 b' def display(*objs, **kwargs):'
110
111
111 from IPython.core.interactiveshell import InteractiveShell
112 from IPython.core.interactiveshell import InteractiveShell
112
113
114 if isinstance(obj, Widget):
115 obj._repr_widget_(**kwargs)
116 else:
113 if raw:
117 if raw:
114 for obj in objs:
118 for obj in objs:
115 publish_display_data('display', obj, metadata)
119 publish_display_data('display', obj, metadata)
General Comments 0
You need to be logged in to leave comments. Login now