##// END OF EJS Templates
Add support for Message class.
Jonathan Frederic -
Show More
@@ -11,6 +11,7 b' import sys'
11 from IPython.utils.traitlets import Unicode, List
11 from IPython.utils.traitlets import Unicode, List
12 from IPython.display import clear_output
12 from IPython.display import clear_output
13 from IPython.testing.skipdoctest import skip_doctest
13 from IPython.testing.skipdoctest import skip_doctest
14 from IPython.kernel.zmq.session import Message
14
15
15 @skip_doctest
16 @skip_doctest
16 class Output(DOMWidget):
17 class Output(DOMWidget):
@@ -50,9 +51,9 b' class Output(DOMWidget):'
50 buffers=None, track=False, header=None, metadata=None):
51 buffers=None, track=False, header=None, metadata=None):
51
52
52 # Handle both prebuild messages and unbuilt messages.
53 # Handle both prebuild messages and unbuilt messages.
53 if isinstance(msg_or_type, dict):
54 if isinstance(msg_or_type, (Message, dict)):
54 msg_type = msg_or_type['msg_type']
55 msg_type = msg_or_type['msg_type']
55 msg = msg_or_type
56 msg = dict(msg_or_type)
56 else:
57 else:
57 msg_type = msg_or_type
58 msg_type = msg_or_type
58 msg = session.msg(msg_type, content=content, parent=parent,
59 msg = session.msg(msg_type, content=content, parent=parent,
General Comments 0
You need to be logged in to leave comments. Login now