b.h.KnownHooksRegistry(registry.Registry) : class documentation

Part of bzrlib.hooks View In Hierarchy

No class docstring
Method register_lazy_hook Undocumented
Method iter_parent_objects Yield (hook_key, (parent_object, attr)) tuples for every registered
Method key_to_parent_and_attribute Convert a known_hooks key to a (parent_obj, attr) pair.

Inherited from Registry:

Method __init__ Create a new Registry.
Method register Register a new object to a name.
Method register_lazy Register a new object to be loaded on request.
Method get Return the object register()'ed to the given key.
Method get_prefix Return an object whose key is a prefix of the supplied value.
Method get_help Get the help text associated with the given key
Method get_info Get the extra information associated with the given key
Method remove Remove a registered entry.
Method __contains__ Undocumented
Method keys Get a list of registered entries
Method iteritems Undocumented
Method items Undocumented
Method _add_help_and_info Add the help and information about this key
Method _get_module Return the module the object will be or was loaded from.
Method _get_key_or_default Return either 'key' or the default key if key is None
Method _set_default_key Undocumented
Method _get_default_key Undocumented
def register_lazy_hook(self, hook_module_name, hook_member_name, hook_factory_member_name):
Undocumented
def iter_parent_objects(self):
Yield (hook_key, (parent_object, attr)) tuples for every registered hook, where 'parent_object' is the object that holds the hook instance.

This is useful for resetting/restoring all the hooks to a known state, as is done in bzrlib.tests.TestCase._clear_hooks.

def key_to_parent_and_attribute(self, (module_name, member_name)):
Convert a known_hooks key to a (parent_obj, attr) pair.
ParameterskeyA tuple (module_name, member_name) as found in the keys of the known_hooks registry.
ReturnsThe parent_object of the hook and the name of the attribute on that parent object where the hook is kept.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.