Part of bzrlib.hooks View In Hierarchy
Known subclasses: bzrlib.branch.BranchHooks, bzrlib.commands.CommandHooks, bzrlib.config._ConfigHooks, bzrlib.config._OldConfigHooks, bzrlib.info.InfoHooks, bzrlib.lock.LockHooks, bzrlib.merge.MergeHooks, bzrlib.msgeditor.MessageEditorHooks, bzrlib.plugins.launchpad.lp_propose.ProposeMergeHooks, bzrlib.smart.client.SmartClientHooks, bzrlib.smart.server.SmartServerHooks, bzrlib.status.StatusHooks, bzrlib.tests.transport_util.TransportHooks, bzrlib.version_info_formats.format_rio.RioVersionInfoBuilderHooks
e.g. ['FOO'] Is the list of items to be called when the FOO hook is triggered.
Method | __init__ | Create a new hooks dictionary. |
Method | add_hook | Add a hook point to this dictionary. |
Method | create_hook | Create a hook which can have callbacks registered for it. |
Method | docs | Generate the documentation for this Hooks instance. |
Method | get_hook_name | Get the name for a_callable for UI display. |
Method | install_named_hook_lazy | Install a_callable in to the hook hook_name lazily, and label it. |
Method | install_named_hook | Install a_callable in to the hook hook_name, and label it name. |
Method | uninstall_named_hook | Uninstall named hooks. |
Method | name_hook | Associate name with a_callable to show users what is running. |
Parameters | module | The module from which this hooks dictionary should be loaded (used for lazy hooks) |
member_name | Name under which this hooks dictionary should be loaded. (used for lazy hooks) |
Parameters | name | The name of the hook, for clients to use when registering. |
doc | The docs for the hook. | |
introduced | When the hook was introduced (e.g. (0, 15)). | |
deprecated | When the hook was deprecated, None for not-deprecated. |
Parameters | hook | The hook to create. An object meeting the protocol of bzrlib.hooks.HookPoint. It's name is used as the key for future lookups. |
This introspects all the individual hooks and returns their docs as well.
If no name has been registered, the string 'No hook name' is returned. We use a fixed string rather than repr or the callables module because the code names are rarely meaningful for end users and this is not intended for debugging.
Parameters | hook_name | A hook name. See the __init__ method for the complete list of hooks. |
callable_module | Name of the module in which the callable is present. | |
callable_member | Member name of the callable. | |
name | A name to associate the callable with, to show users what is running. |
Parameters | hook_name | A hook name. See the __init__ method for the complete list of hooks. |
a_callable | The callable to be invoked when the hook triggers. The exact signature will depend on the hook - see the __init__ method for details on each hook. | |
name | A name to associate a_callable with, to show users what is running. |