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