Inherits from
- BaseTraitHandler: enthought.traits.trait_handlers.BaseTraitHandler
Attributes
Inherited from base classes
Method summary
- validate(self, object, name, value)
Inherited from base classes
- arg_error(self, method, arg_num, object, name, value)
- create_editor(self)
- dup_arg_error(self, method, arg_num, object, name)
- error(self, object, name, value)
- full_info(self, object, name, value)
- get_editor(self, trait = None)
- info(self)
- inner_traits(self)
- is_valid(self, object, name, value)
- keyword_error(self, method, object, name, value)
- missing_arg_error(self, method, arg_num, object, name)
- repr(self, value)
- return_error(self, method, object, value)
Methods
- validate(self, object, name, value)
Verifies whether a new value assigned to a trait attribute is valid.
Parameters
- object : object
- The object whose attribute is being assigned
- name : string
- The name of the attribute being assigned
- value
- The proposed new value for the attribute
Returns
If the new value is valid, this method must return either the original value passed to it, or an alternate value to be assigned in place of the original value. Whatever value this method returns is the actual value assigned to object.name.
Description
This method must be implemented by subclasses of TraitHandler. It is called whenever a new value is assigned to a trait attribute defined using this trait handler.
If the value received by validate() is not valid for the trait attribute, the method must called the predefined error() method to raise a TraitError exception