Skip to content

Commit e88f38c

Browse files
committed
Remove comm_info workaround
1 parent 1c55051 commit e88f38c

File tree

3 files changed

+5
-43
lines changed

3 files changed

+5
-43
lines changed

ipywidgets/__init__.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,3 @@ def _handle_ipython():
3535
load_ipython_extension(ip)
3636

3737
_handle_ipython()
38-
39-
40-
# Workaround for the absence of a comm_info_[request/reply] shell message
41-
class CommInfo(Widget):
42-
"""CommInfo widgets are is typically instantiated by the front-end.
43-
44-
As soon as it is instantiated, it sends the collection of valid comms, and
45-
kills itself. It is a workaround to the absence of comm_info shell
46-
message.
47-
"""
48-
49-
def __init__(self, **kwargs):
50-
super(CommInfo, self).__init__(**kwargs)
51-
target_name = 'ipython.widget'
52-
comms = {
53-
k: dict(target_name=v.target_name)
54-
for (k, v) in self.comm.kernel.comm_manager.comms.items()
55-
if v is not self.comm and (v.target_name == target_name or target_name is None)
56-
}
57-
self.send(dict(comms=comms))
58-
self.close()

ipywidgets/static/widgets/js/manager.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -266,30 +266,13 @@ define([
266266

267267
WidgetManager.prototype._get_comm_info = function() {
268268
/**
269-
* Gets a promise for the open comms in the backend
269+
* Gets a promise for the valid widget models.
270270
*/
271-
272-
// Version using the comm_list_[request/reply] shell message.
273-
/*var that = this;
274-
return new Promise(function(resolve, reject) {
275-
kernel.comm_info(function(msg) {
276-
resolve(msg['content']['comms']);
277-
});
278-
});*/
279-
280-
// Workaround for absence of comm_list_[request/reply] shell message.
281-
// Create a new widget that gives the comm list and commits suicide.
282271
var that = this;
283272
return this._get_connected_kernel().then(function(kernel) {
284273
return new Promise(function(resolve, reject) {
285-
var comm = kernel.comm_manager.new_comm('ipython.widget',
286-
{'widget_class': 'ipywidgets.CommInfo'},
287-
'comm_info');
288-
comm.on_msg(function(msg) {
289-
var data = msg.content.data;
290-
if (data.content && data.method === 'custom') {
291-
resolve(data.content.comms);
292-
}
274+
kernel.comm_info('ipython.widget', function(msg) {
275+
resolve(msg['content']['comms']);
293276
});
294277
});
295278
});

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ def run(self):
280280

281281
setuptools_args = {}
282282
install_requires = setuptools_args['install_requires'] = [
283-
'ipython>=4.0.0dev0',
284-
'ipykernel',
283+
'ipython>=4.0.0',
284+
'ipykernel>=4.2.0',
285285
'traitlets',
286286
'notebook',
287287
]

0 commit comments

Comments
 (0)