Inherits from
- HasPrivateTraits: enthought.traits.has_traits.HasPrivateTraits
Attributes
- class_map
Mappings from a pickled class to a class it should be unpickled as.
The keys are a tuple of the source class's module and class names in that order. The values are the target class's module and class names in that order.
class_map = Dict(Tuple(Str, Str), Tuple(Str, Str))
- state_functions
State functions that should be called to convert state from one version of a class to another.
The keys are a tuple of the class's module name, class name, and version in that order. The values are a list of functions to be called during unpickling to do the state conversion. Note that the version in the key represents the version that the function converts TO.
state_functions = Dict(Tuple(Str, Str, Int), List)
- version_attribute_map
Our record of the attribute that records the version number for a specific class. If no record is found for a given class, then the default value is used instead -- see '_default_version_attribute'.
The key is a tuple of the class's module name and class name in that order. The value is the name of the version attribute.
version_attribute_map = Dict(Tuple(Str, Str), Str)
Inherited from base classes
Method summary
- add_mapping(self, source_module, source_name, target_module, target_name)
- add_mapping_to_class(self, source_module, source_name, target_class)
- add_mappings(self, source_module, target_module, class_names)
- add_state_function(self, module, name, target_version, function)
- add_state_function_for_class(self, klass, target_version, function)
- declare_version_attribute(self, module, name, attribute_name)
- declare_version_attribute_for_class(self, klass, attribute_name)
- get_version_attribute(self, module, name)
- has_class_mapping(self, module, name)
- has_state_function(self, module, name)
- merge_updater(self, updater)
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
- add_mapping(self, source_module, source_name, target_module, target_name)
Adds a mapping from the class with the source name in the source module to the class with the target name in the target module.
- add_mapping_to_class(self, source_module, source_name, target_class)
Convenience method to add a mapping, from the class with the source name in the source module to the target class.
- add_mappings(self, source_module, target_module, class_names)
Adds mappings, from the specified source module to the specified target module, for each of the class names in the specified list.
- add_state_function(self, module, name, target_version, function)
Adds the specified function as a state function to be called to convert an instance of the class with the specified name within the specified module TO the specified version.
Note that the framework handles calling of state functions to make the smallest version jumps possible.
- add_state_function_for_class(self, klass, target_version, function)
Convenience method to add the specified function as a state function to be called to convert an instance of the specified class TO the specified version.
- declare_version_attribute(self, module, name, attribute_name)
Adds the specified attribute name as the version attribute for the class within the specified module with the specified name.
- declare_version_attribute_for_class(self, klass, attribute_name)
Covenience method to add the specified attribute name as the version attribute for the specified class.
- get_version_attribute(self, module, name)
Returns the name of the version attribute for the class of the specified name within the specified module.
- has_class_mapping(self, module, name)
Returns True if this updater contains a class mapping for the class identified by the specified module and class name.
- has_state_function(self, module, name)
Returns True if this updater contains any state functions for the class identified by the specified module and class name.
- merge_updater(self, updater)
Merges the mappings and state functions from the specified updater into this updater.