Show More
@@ -1,26 +1,16 b'' | |||
|
1 | 1 | """Base class for a Comm""" |
|
2 | 2 | |
|
3 | #----------------------------------------------------------------------------- | |
|
4 | # Copyright (C) 2013 The IPython Development Team | |
|
5 | # | |
|
6 | # Distributed under the terms of the BSD License. The full license is in | |
|
7 | # the file COPYING, distributed as part of this software. | |
|
8 | #----------------------------------------------------------------------------- | |
|
9 | ||
|
10 | #----------------------------------------------------------------------------- | |
|
11 | # Imports | |
|
12 | #----------------------------------------------------------------------------- | |
|
3 | # Copyright (c) IPython Development Team. | |
|
4 | # Distributed under the terms of the Modified BSD License. | |
|
13 | 5 | |
|
14 | 6 | import uuid |
|
15 | 7 | |
|
16 | 8 | from IPython.config import LoggingConfigurable |
|
17 | 9 | from IPython.core.getipython import get_ipython |
|
18 | 10 | |
|
11 | from IPython.utils.jsonutil import json_clean | |
|
19 | 12 | from IPython.utils.traitlets import Instance, Unicode, Bytes, Bool, Dict, Any |
|
20 | 13 | |
|
21 | #----------------------------------------------------------------------------- | |
|
22 | # Code | |
|
23 | #----------------------------------------------------------------------------- | |
|
24 | 14 | |
|
25 | 15 | class Comm(LoggingConfigurable): |
|
26 | 16 | |
@@ -69,9 +59,10 b' class Comm(LoggingConfigurable):' | |||
|
69 | 59 | """Helper for sending a comm message on IOPub""" |
|
70 | 60 | data = {} if data is None else data |
|
71 | 61 | metadata = {} if metadata is None else metadata |
|
62 | content = json_clean(dict(data=data, comm_id=self.comm_id, **keys)) | |
|
72 | 63 | self.session.send(self.iopub_socket, msg_type, |
|
73 | dict(data=data, comm_id=self.comm_id, **keys), | |
|
74 | metadata=metadata, | |
|
64 | content, | |
|
65 | metadata=json_clean(metadata), | |
|
75 | 66 | parent=self.shell.get_parent(), |
|
76 | 67 | ident=self.topic, |
|
77 | 68 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now