HookList#
- class HookList(*args, **kwargs)#
The HookList struct represents a list of hook functions.
Methods#
- class HookList
-
- init(hook_size: int) None#
Initializes a
HookList. This must be called before theHookListis used.- Parameters:
hook_size – the size of each element in the
HookList, typicallysizeof (GHook).
- invoke(may_recurse: bool) None#
Calls all of the
Hookfunctions in aHookList.- Parameters:
may_recurse –
Trueif functions which are already running (e.g. in another thread) can be called. If set toFalse, these are skipped
- invoke_check(may_recurse: bool) None#
Calls all of the
Hookfunctions in aHookList. Any function which returnsFalseis removed from theHookList.- Parameters:
may_recurse –
Trueif functions which are already running (e.g. in another thread) can be called. If set toFalse, these are skipped
- marshal(may_recurse: bool, marshaller: Callable[[Hook, Any], None], marshal_data: Any = None) None#
Calls a function on each valid
Hook.- Parameters:
may_recurse –
Trueif hooks which are currently running (e.g. in another thread) are considered valid. If set toFalse, these are skippedmarshaller – the function to call for each
Hookmarshal_data – data to pass to
marshaller
- marshal_check(may_recurse: bool, marshaller: Callable[[Hook, Any], bool], marshal_data: Any = None) None#
Calls a function on each valid
Hookand destroys it if the function returnsFalse.- Parameters:
may_recurse –
Trueif hooks which are currently running (e.g. in another thread) are considered valid. If set toFalse, these are skippedmarshaller – the function to call for each
Hookmarshal_data – data to pass to
marshaller