Browse code

import ipywidgets as ipywidgets instead of widgets

Bas Nijholt authored on 16/02/2018 15:53:07 • Joseph Weston committed on 16/02/2018 16:48:29
Showing 1 changed files
... ...
@@ -136,13 +136,13 @@ def live_info(runner, *, update_interval=0.5):
136 136
     Returns an interactive ipywidget that can be
137 137
     visualized in a Jupyter notebook.
138 138
     """
139
-    import ipywidgets as widgets
139
+    import ipywidgets
140 140
     from IPython.display import display
141 141
 
142
-    status = widgets.HTML(value=_info_html(runner))
142
+    status = ipywidgets.HTML(value=_info_html(runner))
143 143
 
144
-    cancel = widgets.Button(description='cancel runner',
145
-                            layout=widgets.Layout(width='100px'))
144
+    cancel = ipywidgets.Button(description='cancel runner',
145
+                            layout=ipywidgets.Layout(width='100px'))
146 146
     cancel.on_click(lambda _: runner.cancel())
147 147
 
148 148
     async def update():
... ...
@@ -153,10 +153,10 @@ def live_info(runner, *, update_interval=0.5):
153 153
 
154 154
     runner.ioloop.create_task(update())
155 155
 
156
-    hbox = widgets.HBox(
156
+    hbox = ipywidgets.HBox(
157 157
         (status, cancel),
158 158
         description='Runner stats',
159
-        layout=widgets.Layout(border='solid 1px',
159
+        layout=ipywidgets.Layout(border='solid 1px',
160 160
                               width='200px',
161 161
                               align_items='center'),
162 162
     )