Plugins

This section contains all API references of the kadi.plugins package that were not already listed in other sections.

kadi.plugins.core.run_hook(name, **kwargs)[source]

Run the plugin hook with the given name for all registered plugins.

Parameters
  • name – The name of the hook.

  • **kwargs – Additional keyword arguments that will be passed to the hook.

Returns

A single result, if firstresult is set to True in the hook spec, or a list of results.

Raises

ValueError – If no valid hook with the given name was found.

kadi.plugins.core.template_hook(name, **kwargs)[source]

Run the plugin hook with the given name inside a template.

Uses run_hook() and joins multiple results together as a string ready to be inserted into a template.

Parameters
Returns

The template string, which may be empty if the given hook was not found or raised an exception.

kadi.plugins.core.get_plugin_config(name)[source]

Get the configuration of a plugin.

For each plugin, configuration can be specified by mapping the name of the plugin to the configuration that the plugin expects in the PLUGIN_CONFIG value as configured in the application’s configuration. Each configuration has to be specified as a dictionary.

Parameters

name – The name of the plugin.

Returns

The plugin configuration or an empty dictionary if no valid configuration could be found.