mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-31 13:40:29 +08:00
Cleaned up python widget classes
This commit is contained in:
parent
7490cab0c1
commit
f037f2bd42
@ -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)
|
||||
|
@ -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 = []
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user