Show More
@@ -50,7 +50,6 b' class Comm(LoggingConfigurable):' | |||
|
50 | 50 | if target_name: |
|
51 | 51 | kwargs['target_name'] = target_name |
|
52 | 52 | super(Comm, self).__init__(**kwargs) |
|
53 | get_ipython().comm_manager.register_comm(self) | |
|
54 | 53 | if self.primary: |
|
55 | 54 | # I am primary, open my peer. |
|
56 | 55 | self.open(data) |
@@ -70,7 +69,6 b' class Comm(LoggingConfigurable):' | |||
|
70 | 69 | def __del__(self): |
|
71 | 70 | """trigger close on gc""" |
|
72 | 71 | self.close() |
|
73 | get_ipython().comm_manager.unregister_comm(self) | |
|
74 | 72 | |
|
75 | 73 | # publishing messages |
|
76 | 74 | |
@@ -78,6 +76,8 b' class Comm(LoggingConfigurable):' | |||
|
78 | 76 | """Open the frontend-side version of this comm""" |
|
79 | 77 | if data is None: |
|
80 | 78 | data = self._open_data |
|
79 | self._closed = False | |
|
80 | get_ipython().comm_manager.register_comm(self) | |
|
81 | 81 | self._publish_msg('comm_open', data, metadata, target_name=self.target_name) |
|
82 | 82 | |
|
83 | 83 | def close(self, data=None, metadata=None): |
@@ -88,6 +88,7 b' class Comm(LoggingConfigurable):' | |||
|
88 | 88 | if data is None: |
|
89 | 89 | data = self._close_data |
|
90 | 90 | self._publish_msg('comm_close', data, metadata) |
|
91 | get_ipython().comm_manager.unregister_comm(self) | |
|
91 | 92 | self._closed = True |
|
92 | 93 | |
|
93 | 94 | def send(self, data=None, metadata=None): |
General Comments 0
You need to be logged in to leave comments.
Login now