##// END OF EJS Templates
Cleaned up python widget classes
Jonathan Frederic -
Show More
@@ -1,15 +1,12 b''
1 import os
2
3 1 from base import Widget
4 2 from IPython.utils.traitlets import Unicode, Bool, List
5 3
6 4 class BoolWidget(Widget):
7 5 target_name = Unicode('BoolWidgetModel')
8 6 default_view_name = Unicode('CheckboxView')
9 js_requirements = List(["static/notebook/js/widgets/bool.js"])
10 7 _keys = ['value', 'description', 'disabled']
11 8
12 9 value = Bool(False)
13 10 description = Unicode('') # Description of the boolean (label).
14 11 disabled = Bool(False) # Enable or disable user changes
15 12 No newline at end of file
@@ -1,12 +1,7 b''
1 import os
2
3 1 from base import Widget
4 from IPython.utils.traitlets import Unicode, List
5 from IPython.utils.javascript import display_all_js
2 from IPython.utils.traitlets import Unicode
6 3
7 4 class ContainerWidget(Widget):
8 5 target_name = Unicode('container_widget')
9 6 default_view_name = Unicode('ContainerView')
10 js_requirements = List(["static/notebook/js/widgets/container.js"])
11
12 _keys = []
7 No newline at end of file
@@ -1,18 +1,14 b''
1 import os
2
3 1 from base import Widget
4 2 from IPython.utils.traitlets import Unicode, Float, Bool, List
5 from IPython.utils.javascript import display_all_js
6 3
7 4 class FloatRangeWidget(Widget):
8 5 target_name = Unicode('FloatRangeWidgetModel')
9 6 default_view_name = Unicode('FloatSliderView')
10 js_requirements = List(["static/notebook/js/widgets/float_range.js"])
11 7 _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation']
12 8
13 9 value = Float(0.0)
14 10 max = Float(100.0) # Max value
15 11 min = Float(0.0) # Min value
16 12 disabled = Bool(False) # Enable or disable user changes
17 13 step = Float(0.1) # Minimum step that the value can take (ignored by some views)
18 14 orientation = Unicode(u'horizontal') # Vertical or horizontal (ignored by some views)
@@ -1,18 +1,14 b''
1 import os
2
3 1 from base import Widget
4 2 from IPython.utils.traitlets import Unicode, Int, Bool, List
5 from IPython.utils.javascript import display_all_js
6 3
7 4 class IntRangeWidget(Widget):
8 5 target_name = Unicode('IntRangeWidgetModel')
9 6 default_view_name = Unicode('IntSliderView')
10 js_requirements = List(["static/notebook/js/widgets/int_range.js"])
11 7 _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation']
12 8
13 9 value = Int(0)
14 10 max = Int(100) # Max value
15 11 min = Int(0) # Min value
16 12 disabled = Bool(False) # Enable or disable user changes
17 13 step = Int(1) # Minimum step that the value can take (ignored by some views)
18 14 orientation = Unicode(u'horizontal') # Vertical or horizontal (ignored by some views)
@@ -1,16 +1,12 b''
1 import os
2
3 1 from base import Widget
4 2 from IPython.utils.traitlets import Unicode, List, Bool
5 from IPython.utils.javascript import display_all_js
6 3
7 4 class SelectionWidget(Widget):
8 5 target_name = Unicode('SelectionWidgetModel')
9 6 default_view_name = Unicode('DropdownView')
10 js_requirements = List(["static/notebook/js/widgets/selection.js"])
11 7 _keys = ['value', 'values', 'disabled']
12 8
13 9 value = Unicode()
14 10 values = List() # List of values the user can select
15 11 disabled = Bool(False) # Enable or disable user changes
16 12 No newline at end of file
@@ -1,15 +1,11 b''
1 import os
2
3 1 from base import Widget
4 2 from IPython.utils.traitlets import Unicode, Bool, List
5 from IPython.utils.javascript import display_all_js
6 3
7 4 class StringWidget(Widget):
8 5 target_name = Unicode('StringWidgetModel')
9 6 default_view_name = Unicode('TextboxView')
10 js_requirements = List(["static/notebook/js/widgets/string.js"])
11 _keys = ['value', 'row_count', 'disabled']
7 _keys = ['value', 'disabled']
12 8
13 9 value = Unicode()
14 10 disabled = Bool(False) # Enable or disable user changes
15 11 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now