|
40 | 40 | from ipywidgets.widgets import SelectionSlider, ValueWidget, ToggleButtons |
41 | 41 | from ipywidgets.widgets.interaction import interactive, signature |
42 | 42 |
|
43 | | -from .widgets import EvalText, SageColorPicker |
44 | | -from sage.structure.element import parent |
45 | 43 | import sage.rings.abc |
| 44 | + |
46 | 45 | from sage.misc.lazy_import import lazy_import |
47 | | -from sage.structure.element import Matrix |
| 46 | +from sage.repl.ipython_kernel.widgets import EvalText, SageColorPicker |
| 47 | +from sage.structure.element import Matrix, parent |
| 48 | + |
48 | 49 | lazy_import("sage.plot.colors", "Color") |
49 | 50 |
|
50 | 51 |
|
@@ -176,13 +177,8 @@ def widget_from_single_value(cls, abbrev, *args, **kwds): |
176 | 177 | return input_grid(abbrev.nrows(), abbrev.ncols(), |
177 | 178 | default=abbrev.list(), to_value=abbrev.parent()) |
178 | 179 |
|
179 | | - try: |
180 | | - from sage.plot.colors import Color |
181 | | - except ImportError: |
182 | | - pass |
183 | | - else: |
184 | | - if isinstance(abbrev, Color): |
185 | | - return SageColorPicker(value=abbrev.html_color()) |
| 180 | + if isinstance(abbrev, Color): |
| 181 | + return SageColorPicker(value=abbrev.html_color()) |
186 | 182 | # Get widget from IPython if possible |
187 | 183 | widget = super().widget_from_single_value(abbrev, *args, **kwds) |
188 | 184 | if widget is not None or isinstance(abbrev, Iterable): |
|
0 commit comments