Merge pull request #7708 from SylvainCorlay/allow_none

allow_none=False for all trait types but Instance and Type
Min RK 11 years ago
commit 9ded491c97

@ -109,7 +109,7 @@ class ContentsManager(LoggingConfigurable):
checkpoints_class = Type(Checkpoints, config=True)
checkpoints = Instance(Checkpoints, config=True)
checkpoints_kwargs = Dict(allow_none=False, config=True)
checkpoints_kwargs = Dict(config=True)
def _checkpoints_default(self):
return self.checkpoints_class(**self.checkpoints_kwargs)

@ -140,7 +140,7 @@ class Widget(LoggingConfigurable):
_property_lock = Tuple((None, None))
_send_state_lock = Int(0)
_states_to_send = Set(allow_none=False)
_states_to_send = Set()
_display_callbacks = Instance(CallbackDispatcher, ())
_msg_callbacks = Instance(CallbackDispatcher, ())

@ -18,16 +18,16 @@ class Box(DOMWidget):
# Child widgets in the container.
# Using a tuple here to force reassignment to update the list.
# When a proper notifying-list trait exists, that is what should be used here.
children = Tuple(sync=True, allow_none=False)
children = Tuple(sync=True)
_overflow_values = ['visible', 'hidden', 'scroll', 'auto', 'initial', 'inherit', '']
overflow_x = CaselessStrEnum(
values=_overflow_values,
default_value='', allow_none=False, sync=True, help="""Specifies what
default_value='', sync=True, help="""Specifies what
happens to content that is too large for the rendered region.""")
overflow_y = CaselessStrEnum(
values=_overflow_values,
default_value='', allow_none=False, sync=True, help="""Specifies what
default_value='', sync=True, help="""Specifies what
happens to content that is too large for the rendered region.""")
box_style = CaselessStrEnum(
@ -59,10 +59,10 @@ class FlexBox(Box):
_locations = ['start', 'center', 'end', 'baseline', 'stretch']
pack = CaselessStrEnum(
values=_locations,
default_value='start', allow_none=False, sync=True)
default_value='start', sync=True)
align = CaselessStrEnum(
values=_locations,
default_value='start', allow_none=False, sync=True)
default_value='start', sync=True)
def VBox(*pargs, **kwargs):

@ -130,8 +130,7 @@ class FloatSlider(_BoundedFloat):
"""
_view_name = Unicode('FloatSliderView', sync=True)
orientation = CaselessStrEnum(values=['horizontal', 'vertical'],
default_value='horizontal',
help="Vertical or horizontal.", allow_none=False, sync=True)
default_value='horizontal', help="Vertical or horizontal.", sync=True)
_range = Bool(False, help="Display a range selector", sync=True)
readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)
slider_color = Unicode(sync=True)
@ -285,8 +284,7 @@ class FloatRangeSlider(_BoundedFloatRange):
"""
_view_name = Unicode('FloatSliderView', sync=True)
orientation = CaselessStrEnum(values=['horizontal', 'vertical'],
default_value='horizontal', allow_none=False,
help="Vertical or horizontal.", sync=True)
default_value='horizontal', help="Vertical or horizontal.", sync=True)
_range = Bool(True, help="Display a range selector", sync=True)
readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)
slider_color = Unicode(sync=True)

@ -84,8 +84,7 @@ class IntSlider(_BoundedInt):
"""Slider widget that represents a int bounded by a minimum and maximum value."""
_view_name = Unicode('IntSliderView', sync=True)
orientation = CaselessStrEnum(values=['horizontal', 'vertical'],
default_value='horizontal', allow_none=False,
help="Vertical or horizontal.", sync=True)
default_value='horizontal', help="Vertical or horizontal.", sync=True)
_range = Bool(False, help="Display a range selector", sync=True)
readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)
slider_color = Unicode(sync=True)
@ -196,8 +195,7 @@ class IntRangeSlider(_BoundedIntRange):
"""Slider widget that represents a pair of ints between a minimum and maximum value."""
_view_name = Unicode('IntSliderView', sync=True)
orientation = CaselessStrEnum(values=['horizontal', 'vertical'],
default_value='horizontal', allow_none=False,
help="Vertical or horizontal.", sync=True)
default_value='horizontal', help="Vertical or horizontal.", sync=True)
_range = Bool(True, help="Display a range selector", sync=True)
readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)
slider_color = Unicode(sync=True)

Loading…
Cancel
Save