-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Output widget with Interact #7554
Conversation
@@ -34,6 +34,10 @@ class Output(DOMWidget): | |||
print('prints to output widget')""" | |||
_view_name = Unicode('OutputView', sync=True) | |||
|
|||
def __init__(self, *args, **kwargs): | |||
super(Output, self).__init__(*args, **kwargs) | |||
self._ip = get_ipython() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is missing from IPython import get_ipython
Travis failures look real. Missing |
6632b63
to
996c4d7
Compare
Tests are failing with a few off-by-one errors, but it looks like the tests need updating rather than an actual bug, since an extra widget is added to the collection. |
996c4d7
to
79b63be
Compare
Looks like this is passing now. |
@@ -80,7 +80,8 @@ def check_widgets(container, **to_check): | |||
# build a widget dictionary, so it matches | |||
widgets = {} | |||
for w in container.children: | |||
widgets[w.description] = w | |||
if hasattr(w, 'description'): | |||
widgets[w.description] = w |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that widgets without a description will be excluded from the dict. Is there a problem with doing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be a problem, widgets without descriptions cause this code (without the check) to barf, so they can't be included as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
closes #6534
alternative to #7482
Ping @jasongrout who was also interested in this solution.
Also this fixes a small bug in which
get_ipython
is not defined in the context where the Output widget is__enter__
ed.