Skip to content

hooks

Hook support.

Authors:

  • Kenneth Hoste (Ghent University)

find_hook(label, hooks, pre_step_hook=False, post_step_hook=False)

Find hook with specified label.

PARAMETER DESCRIPTION
label

name of hook

hooks

dict of defined hooks

pre_step_hook

indicates whether hook to run is a pre-step hook

DEFAULT: False

post_step_hook

indicates whether hook to run is a post-step hook

DEFAULT: False

load_hooks(hooks_path)

Load defined hooks (if any).

run_hook(label, hooks, pre_step_hook=False, post_step_hook=False, args=None, kwargs=None, msg=None)

Run hook with specified label and return result of calling the hook or None.

PARAMETER DESCRIPTION
label

name of hook

hooks

dict of defined hooks

pre_step_hook

indicates whether hook to run is a pre-step hook

DEFAULT: False

post_step_hook

indicates whether hook to run is a post-step hook

DEFAULT: False

args

arguments to pass to hook function

DEFAULT: None

msg

custom message that is printed when hook is called

DEFAULT: None

verify_hooks(hooks)

Check whether obtained hooks only includes known hooks.