Skip to content

Commit 4fa9653

Browse files
committed
Remove comm_info workaround
1 parent 7c1e661 commit 4fa9653

File tree

3 files changed

+5
-34
lines changed

3 files changed

+5
-34
lines changed

ipywidgets/__init__.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +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. As soon as it is instantiated, it sends the collection of valid comms, and kills itself. It is a workaround to the absence of comm_info shell message."""
43-
44-
def __init__(self, **kwargs):
45-
super(CommInfo, self).__init__(**kwargs)
46-
self.send(dict(comms={
47-
k: dict(target_name=v.target_name) for (k, v) in self.comm.kernel.comm_manager.comms.items()
48-
}))
49-
self.close()

ipywidgets/static/widgets/js/manager.js

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

511511
WidgetManager.prototype._get_comm_info = function(kernel) {
512512
/**
513-
* Gets a promise for the open comms in the backend
513+
* Gets a promise for the valid widget models.
514514
*/
515-
516-
// Version using the comm_list_[request/reply] shell message.
517-
/*var that = this;
515+
var that = this;
518516
return new Promise(function(resolve, reject) {
519-
kernel.comm_info(function(msg) {
517+
kernel.comm_info('ipython.widget', function(msg) {
520518
resolve(msg['content']['comms']);
521519
});
522-
});*/
523-
524-
// Workaround for absence of comm_list_[request/reply] shell message.
525-
// Create a new widget that gives the comm list and commits suicide.
526-
var that = this;
527-
return new Promise(function(resolve, reject) {
528-
var comm = that.comm_manager.new_comm('ipython.widget',
529-
{'widget_class': 'ipywidgets.CommInfo'},
530-
'comm_info');
531-
comm.on_msg(function(msg) {
532-
var data = msg.content.data;
533-
if (data.content && data.method === 'custom') {
534-
resolve(data.content.comms);
535-
}
536-
});
537520
});
538521
};
539522

setup.py

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

277277
setuptools_args = {}
278278
install_requires = setuptools_args['install_requires'] = [
279-
'ipython>=4.0.0dev0',
280-
'ipykernel',
279+
'ipython>=4.0.0',
280+
'ipykernel>=4.1.0',
281281
'traitlets',
282282
'notebook',
283283
]

0 commit comments

Comments
 (0)