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