Cleaned up python widget classes

This commit is contained in:
Jonathan Frederic 2013-10-18 20:32:32 +00:00
parent 7490cab0c1
commit f037f2bd42
4 changed files with 3 additions and 19 deletions

View File

@ -1,12 +1,9 @@
import os
from base import Widget
from IPython.utils.traitlets import Unicode, Bool, List
class BoolWidget(Widget):
target_name = Unicode('BoolWidgetModel')
default_view_name = Unicode('CheckboxView')
js_requirements = List(["static/notebook/js/widgets/bool.js"])
_keys = ['value', 'description', 'disabled']
value = Bool(False)

View File

@ -1,12 +1,7 @@
import os
from base import Widget
from IPython.utils.traitlets import Unicode, List
from IPython.utils.javascript import display_all_js
from IPython.utils.traitlets import Unicode
class ContainerWidget(Widget):
target_name = Unicode('container_widget')
default_view_name = Unicode('ContainerView')
js_requirements = List(["static/notebook/js/widgets/container.js"])
_keys = []

View File

@ -1,13 +1,9 @@
import os
from base import Widget
from IPython.utils.traitlets import Unicode, List, Bool
from IPython.utils.javascript import display_all_js
class SelectionWidget(Widget):
target_name = Unicode('SelectionWidgetModel')
default_view_name = Unicode('DropdownView')
js_requirements = List(["static/notebook/js/widgets/selection.js"])
_keys = ['value', 'values', 'disabled']
value = Unicode()

View File

@ -1,14 +1,10 @@
import os
from base import Widget
from IPython.utils.traitlets import Unicode, Bool, List
from IPython.utils.javascript import display_all_js
class StringWidget(Widget):
target_name = Unicode('StringWidgetModel')
default_view_name = Unicode('TextboxView')
js_requirements = List(["static/notebook/js/widgets/string.js"])
_keys = ['value', 'row_count', 'disabled']
_keys = ['value', 'disabled']
value = Unicode()
disabled = Bool(False) # Enable or disable user changes