hooks.base module

Contains a base hooking class used by the hooks package.

class hooks.base._HookBase[source]

Bases: list

Base hook class used to store callbacks for the specific hook type.

append(callback)[source]

Register the given callback to the list.

Parameters:callback – The function to register to the list.
def function(*args, **kwargs):
    # Code...

<_HookBase object>.append(function)
remove(callback)[source]

Unregister the given callback from the list.

Parameters:callback – The function to unregister from the list.
def function(*args, **kwargs):
    # Code...

<_HookBase object>.remove(function)
class_name

Return the name of the class.

class hooks.base._HookDecorator(callback)[source]

Bases: core.AutoUnload

Base decorator class used to add/remove hooks on load/unload.

__init__(callback)[source]

Store the given callback and register the hook.

_unload_instance()[source]

Unregister the hook.