Show More
@@ -79,7 +79,7 b' def _show_traceback(method):' | |||
|
79 | 79 | def register(key=None): |
|
80 | 80 | """Returns a decorator registering a widget class in the widget registry. |
|
81 | 81 | If no key is provided, the class name is used as a key. A key is |
|
82 |
provided for each core |
|
|
82 | provided for each core IPython widget so that the frontend can use | |
|
83 | 83 | this key regardless of the language of the kernel""" |
|
84 | 84 | def wrap(widget): |
|
85 | 85 | l = key if key is not None else widget.__module__ + widget.__name__ |
@@ -27,13 +27,13 b' class _Bool(DOMWidget):' | |||
|
27 | 27 | disabled = Bool(False, help="Enable or disable user changes.", sync=True) |
|
28 | 28 | |
|
29 | 29 | |
|
30 |
@register(' |
|
|
30 | @register('IPython.Checkbox') | |
|
31 | 31 | class Checkbox(_Bool): |
|
32 | 32 | """Displays a boolean `value`.""" |
|
33 | 33 | _view_name = Unicode('CheckboxView', sync=True) |
|
34 | 34 | |
|
35 | 35 | |
|
36 |
@register(' |
|
|
36 | @register('IPython.ToggleButton') | |
|
37 | 37 | class ToggleButton(_Bool): |
|
38 | 38 | """Displays a boolean `value`.""" |
|
39 | 39 |
@@ -10,7 +10,7 b' from .widget import DOMWidget, register' | |||
|
10 | 10 | from IPython.utils.traitlets import Unicode, Tuple, TraitError, Int, CaselessStrEnum |
|
11 | 11 | from IPython.utils.warn import DeprecatedClass |
|
12 | 12 | |
|
13 |
@register(' |
|
|
13 | @register('IPython.Box') | |
|
14 | 14 | class Box(DOMWidget): |
|
15 | 15 | """Displays multiple widgets in a group.""" |
|
16 | 16 | _view_name = Unicode('BoxView', sync=True) |
@@ -45,7 +45,7 b' class Box(DOMWidget):' | |||
|
45 | 45 | child._handle_displayed() |
|
46 | 46 | |
|
47 | 47 | |
|
48 |
@register(' |
|
|
48 | @register('IPython.Popup') | |
|
49 | 49 | class Popup(Box): |
|
50 | 50 | """Displays multiple widgets in an in page popup div.""" |
|
51 | 51 | _view_name = Unicode('PopupView', sync=True) |
@@ -54,7 +54,7 b' class Popup(Box):' | |||
|
54 | 54 | button_text = Unicode(sync=True) |
|
55 | 55 | |
|
56 | 56 | |
|
57 |
@register(' |
|
|
57 | @register('IPython.FlexBox') | |
|
58 | 58 | class FlexBox(Box): |
|
59 | 59 | """Displays multiple widgets using the flexible box model.""" |
|
60 | 60 | _view_name = Unicode('FlexBoxView', sync=True) |
@@ -21,7 +21,7 b' from IPython.utils.warn import DeprecatedClass' | |||
|
21 | 21 | #----------------------------------------------------------------------------- |
|
22 | 22 | # Classes |
|
23 | 23 | #----------------------------------------------------------------------------- |
|
24 |
@register(' |
|
|
24 | @register('IPython.Button') | |
|
25 | 25 | class Button(DOMWidget): |
|
26 | 26 | """Button widget. |
|
27 | 27 |
@@ -43,17 +43,17 b' class _BoundedFloat(_Float):' | |||
|
43 | 43 | self.value = min(max(new, self.min), self.max) |
|
44 | 44 | |
|
45 | 45 | |
|
46 |
@register(' |
|
|
46 | @register('IPython.FloatText') | |
|
47 | 47 | class FloatText(_Float): |
|
48 | 48 | _view_name = Unicode('FloatTextView', sync=True) |
|
49 | 49 | |
|
50 | 50 | |
|
51 |
@register(' |
|
|
51 | @register('IPython.BoundedFloatText') | |
|
52 | 52 | class BoundedFloatText(_BoundedFloat): |
|
53 | 53 | _view_name = Unicode('FloatTextView', sync=True) |
|
54 | 54 | |
|
55 | 55 | |
|
56 |
@register(' |
|
|
56 | @register('IPython.FloatSlider') | |
|
57 | 57 | class FloatSlider(_BoundedFloat): |
|
58 | 58 | _view_name = Unicode('FloatSliderView', sync=True) |
|
59 | 59 | orientation = CaselessStrEnum(values=['horizontal', 'vertical'], |
@@ -64,7 +64,7 b' class FloatSlider(_BoundedFloat):' | |||
|
64 | 64 | slider_color = Unicode(sync=True) |
|
65 | 65 | |
|
66 | 66 | |
|
67 |
@register(' |
|
|
67 | @register('IPython.FloatProgress') | |
|
68 | 68 | class FloatProgress(_BoundedFloat): |
|
69 | 69 | _view_name = Unicode('ProgressView', sync=True) |
|
70 | 70 | |
@@ -167,7 +167,7 b' class _BoundedFloatRange(_FloatRange):' | |||
|
167 | 167 | self.lower = low |
|
168 | 168 | |
|
169 | 169 | |
|
170 |
@register(' |
|
|
170 | @register('IPython.FloatRangeSlider') | |
|
171 | 171 | class FloatRangeSlider(_BoundedFloatRange): |
|
172 | 172 | _view_name = Unicode('FloatSliderView', sync=True) |
|
173 | 173 | orientation = CaselessStrEnum(values=['horizontal', 'vertical'], |
@@ -22,7 +22,7 b' from IPython.utils.warn import DeprecatedClass' | |||
|
22 | 22 | #----------------------------------------------------------------------------- |
|
23 | 23 | # Classes |
|
24 | 24 | #----------------------------------------------------------------------------- |
|
25 |
@register(' |
|
|
25 | @register('IPython.Image') | |
|
26 | 26 | class Image(DOMWidget): |
|
27 | 27 | """Displays an image as a widget. |
|
28 | 28 |
@@ -56,19 +56,19 b' class _BoundedInt(_Int):' | |||
|
56 | 56 | if new > self.max: |
|
57 | 57 | raise ValueError("setting min > max") |
|
58 | 58 | |
|
59 |
@register(' |
|
|
59 | @register('IPython.IntText') | |
|
60 | 60 | class IntText(_Int): |
|
61 | 61 | """Textbox widget that represents a int.""" |
|
62 | 62 | _view_name = Unicode('IntTextView', sync=True) |
|
63 | 63 | |
|
64 | 64 | |
|
65 |
@register(' |
|
|
65 | @register('IPython.BoundedIntText') | |
|
66 | 66 | class BoundedIntText(_BoundedInt): |
|
67 | 67 | """Textbox widget that represents a int bounded by a minimum and maximum value.""" |
|
68 | 68 | _view_name = Unicode('IntTextView', sync=True) |
|
69 | 69 | |
|
70 | 70 | |
|
71 |
@register(' |
|
|
71 | @register('IPython.IntSlider') | |
|
72 | 72 | class IntSlider(_BoundedInt): |
|
73 | 73 | """Slider widget that represents a int bounded by a minimum and maximum value.""" |
|
74 | 74 | _view_name = Unicode('IntSliderView', sync=True) |
@@ -80,7 +80,7 b' class IntSlider(_BoundedInt):' | |||
|
80 | 80 | slider_color = Unicode(sync=True) |
|
81 | 81 | |
|
82 | 82 | |
|
83 |
@register(' |
|
|
83 | @register('IPython.IntProgress') | |
|
84 | 84 | class IntProgress(_BoundedInt): |
|
85 | 85 | """Progress bar that represents a int bounded by a minimum and maximum value.""" |
|
86 | 86 | _view_name = Unicode('ProgressView', sync=True) |
@@ -180,7 +180,7 b' class _BoundedIntRange(_IntRange):' | |||
|
180 | 180 | self.upper = high |
|
181 | 181 | self.lower = low |
|
182 | 182 | |
|
183 |
@register(' |
|
|
183 | @register('IPython.IntRangeSlider') | |
|
184 | 184 | class IntRangeSlider(_BoundedIntRange): |
|
185 | 185 | _view_name = Unicode('IntSliderView', sync=True) |
|
186 | 186 | orientation = CaselessStrEnum(values=['horizontal', 'vertical'], |
@@ -114,7 +114,7 b' class _Selection(DOMWidget):' | |||
|
114 | 114 | self.value_lock.release() |
|
115 | 115 | |
|
116 | 116 | |
|
117 |
@register(' |
|
|
117 | @register('IPython.ToggleButtons') | |
|
118 | 118 | class ToggleButtons(_Selection): |
|
119 | 119 | """Group of toggle buttons that represent an enumeration. Only one toggle |
|
120 | 120 | button can be toggled at any point in time.""" |
@@ -125,7 +125,7 b' class ToggleButtons(_Selection):' | |||
|
125 | 125 | default_value='', allow_none=True, sync=True, help="""Use a |
|
126 | 126 | predefined styling for the buttons.""") |
|
127 | 127 | |
|
128 |
@register(' |
|
|
128 | @register('IPython.Dropdown') | |
|
129 | 129 | class Dropdown(_Selection): |
|
130 | 130 | """Allows you to select a single item from a dropdown.""" |
|
131 | 131 | _view_name = Unicode('DropdownView', sync=True) |
@@ -135,7 +135,7 b' class Dropdown(_Selection):' | |||
|
135 | 135 | default_value='', allow_none=True, sync=True, help="""Use a |
|
136 | 136 | predefined styling for the buttons.""") |
|
137 | 137 | |
|
138 |
@register(' |
|
|
138 | @register('IPython.RadioButtons') | |
|
139 | 139 | class RadioButtons(_Selection): |
|
140 | 140 | """Group of radio buttons that represent an enumeration. Only one radio |
|
141 | 141 | button can be toggled at any point in time.""" |
@@ -143,7 +143,7 b' class RadioButtons(_Selection):' | |||
|
143 | 143 | |
|
144 | 144 | |
|
145 | 145 | |
|
146 |
@register(' |
|
|
146 | @register('IPython.Select') | |
|
147 | 147 | class Select(_Selection): |
|
148 | 148 | """Listbox that only allows one item to be selected at any given time.""" |
|
149 | 149 | _view_name = Unicode('SelectView', sync=True) |
@@ -51,13 +51,13 b' class _SelectionContainer(Box):' | |||
|
51 | 51 | else: |
|
52 | 52 | return None |
|
53 | 53 | |
|
54 |
@register(' |
|
|
54 | @register('IPython.Accordion') | |
|
55 | 55 | class Accordion(_SelectionContainer): |
|
56 | 56 | """Displays children each on a separate accordion page.""" |
|
57 | 57 | _view_name = Unicode('AccordionView', sync=True) |
|
58 | 58 | |
|
59 | 59 | |
|
60 |
@register(' |
|
|
60 | @register('IPython.Tab') | |
|
61 | 61 | class Tab(_SelectionContainer): |
|
62 | 62 | """Displays children each on a separate accordion tab.""" |
|
63 | 63 | _view_name = Unicode('TabView', sync=True) |
@@ -28,20 +28,20 b' class _String(DOMWidget):' | |||
|
28 | 28 | placeholder = Unicode("", help="Placeholder text to display when nothing has been typed", sync=True) |
|
29 | 29 | |
|
30 | 30 | |
|
31 |
@register(' |
|
|
31 | @register('IPython.HTML') | |
|
32 | 32 | class HTML(_String): |
|
33 | 33 | """Renders the string `value` as HTML.""" |
|
34 | 34 | _view_name = Unicode('HTMLView', sync=True) |
|
35 | 35 | |
|
36 | 36 | |
|
37 |
@register(' |
|
|
37 | @register('IPython.Latex') | |
|
38 | 38 | class Latex(_String): |
|
39 | 39 | """Renders math inside the string `value` as Latex (requires $ $ or $$ $$ |
|
40 | 40 | and similar latex tags).""" |
|
41 | 41 | _view_name = Unicode('LatexView', sync=True) |
|
42 | 42 | |
|
43 | 43 | |
|
44 |
@register(' |
|
|
44 | @register('IPython.Textarea') | |
|
45 | 45 | class Textarea(_String): |
|
46 | 46 | """Multiline text area widget.""" |
|
47 | 47 | _view_name = Unicode('TextareaView', sync=True) |
@@ -50,7 +50,7 b' class Textarea(_String):' | |||
|
50 | 50 | self.send({"method": "scroll_to_bottom"}) |
|
51 | 51 | |
|
52 | 52 | |
|
53 |
@register(' |
|
|
53 | @register('IPython.Text') | |
|
54 | 54 | class Text(_String): |
|
55 | 55 | """Single line textbox widget.""" |
|
56 | 56 | _view_name = Unicode('TextView', sync=True) |
General Comments 0
You need to be logged in to leave comments.
Login now