Inherits from
- ListenerBase: enthought.traits.traits_listener.ListenerBase
Attributes
- active
A dictionary mapping objects to a list of all current active (name, type) listener pairs, where type defines the type of listener, one of: (SIMPLE_LISTENER, LIST_LISTENER, DICT_LISTENER).
active = Instance(WeakKeyDictionary, ())
- deferred
Should registering listeners for items reachable from this listener item be deferred until the associated trait is first read or set?
deferred = Bool(False)
- dispatch
The dispatch mechanism to use when invoking the handler:
dispatch = Str
- handler
The handler to be called when any listened-to trait is changed:
handler = Any
- is_any_trait
Is this an 'any_trait' change listener, or does it create explicit listeners for each individual trait?
is_any_trait = Bool(False)
- is_list_handler
Is the associated handler a special list handler that handles both 'foo' and 'foo_items' events by receiving a list of 'deleted' and 'added' items as the 'old' and 'new' arguments?
is_list_handler = Bool(False)
- metadata_defined
Does the specified metadata need to be defined (True) or not defined (False)?
metadata_defined = Bool(True)
- metadata_name
The name of any metadata that must be present (or not present):
metadata_name = Str
- name
The name of the trait to listen to:
name = Str
- next
The next level (if any) of ListenerBase object to be called when any of this object's listened-to traits is changed:
next = Instance(ListenerBase)
- notify
Should changes to this item generate a notification to the handler?
notify = Bool(True)
- priority
Does the handler go at the beginning (True) or end (False) of the notification handlers list?
priority = Bool(False)
- type
The type of handler being used:
type = Enum(ANY_LISTENER, SRC_LISTENER, DST_LISTENER)
- wrapped_handler
A 'wrapped' version of 'handler':
wrapped_handler = Any
Inherited from base classes
Method summary
- __repr__(self, seen = None)
- handle_dict(self, object, name, old, new)
- handle_dict_items(self, object, name, old, new)
- handle_dst(self, object, name, old, new)
- handle_error(self, obj, name, old, new)
- handle_list(self, object, name, old, new)
- handle_list_items(self, object, name, old, new)
- handle_list_items_special(self, object, name, old, new)
- handle_simple(self, object, name, old, new)
- register(self, new)
- unregister(self, old)
Inherited from base classes
- __deepcopy__(self, memo)
- __getstate__(self)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- __setstate__(self, state, trait_change_notify = True)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- has_traits_interface(self, *interfaces)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- __repr__(self, seen = None)
Returns a string representation of the object.
Since the object graph may have cycles, we extend the basic __repr__ API to include a set of objects we've already seen while constructing a string representation. When this method tries to get the repr of a ListenerItem or ListenerGroup, we will use the extended API and build up the set of seen objects. The repr of a seen object will just be '<cycle>'.
- handle_dict(self, object, name, old, new)
Handles a trait change for a dictionary trait.
- handle_dict_items(self, object, name, old, new)
Handles a trait change for items of a dictionary trait.
- handle_dst(self, object, name, old, new)
Handles a trait change for an intermediate link trait when the notification is for the final destination trait.
- handle_error(self, obj, name, old, new)
Handles an invalid intermediate trait change to a handler that must be applied to the final destination object.trait.
- handle_list(self, object, name, old, new)
Handles a trait change for a list (or set) trait.
- handle_list_items(self, object, name, old, new)
Handles a trait change for items of a list (or set) trait.
- handle_list_items_special(self, object, name, old, new)
Handles a trait change for items of a list (or set) trait with notification.
- handle_simple(self, object, name, old, new)
Handles a trait change for an intermediate link trait.
- register(self, new)
Registers new listeners.
- unregister(self, old)
Unregisters any existing listeners.