##// END OF EJS Templates
Move get_ipython call into output widget constructor
Jonathan Frederic -
Show More
@@ -34,6 +34,10 b' class Output(DOMWidget):'
34 print('prints to output widget')"""
34 print('prints to output widget')"""
35 _view_name = Unicode('OutputView', sync=True)
35 _view_name = Unicode('OutputView', sync=True)
36
36
37 def __init__(self, *args, **kwargs):
38 super(Output, self).__init__(*args, **kwargs)
39 self._ip = get_ipython()
40
37 def clear_output(self, *pargs, **kwargs):
41 def clear_output(self, *pargs, **kwargs):
38 with self:
42 with self:
39 clear_output(*pargs, **kwargs)
43 clear_output(*pargs, **kwargs)
@@ -41,7 +45,7 b' class Output(DOMWidget):'
41 def __enter__(self):
45 def __enter__(self):
42 """Called upon entering output widget context manager."""
46 """Called upon entering output widget context manager."""
43 self._flush()
47 self._flush()
44 kernel = get_ipython().kernel
48 kernel = self._ip.kernel
45 session = kernel.session
49 session = kernel.session
46 send = session.send
50 send = session.send
47 self._original_send = send
51 self._original_send = send
General Comments 0
You need to be logged in to leave comments. Login now