project_config.plugins package

Project-config built-in plugins.

These plugins are not required to be specified in plugins properties of styles.

exception project_config.plugins.InvalidPluginFunction(message: str)[source]

Bases: ProjectConfigException

Exception raised when a method of a plugin class is not valid.

class project_config.plugins.Plugins(prepare_all: bool = False)[source]

Bases: object

Plugins wrapper.

Performs all the logic concerning to plugins.

Plugins modules are loaded on demand, only when an action specified by a rule requires it, and cached for later demanding from rules.

_add_plugin_to_cache(plugin_entry_point: EntryPoint) None[source]
_prepare_all_plugins_cache() None[source]
_prepare_default_plugins_cache() None[source]
get_function_for_action(action: str) PluginMethod[source]

Get the function that performs an action given her name.

Parameters:

action (str) – Action name whose function will be returned.

Returns:

Function that process the action.

Return type:

type

is_valid_action(action: str) bool[source]

Return if an action exists in available plugins.

Parameters:

action (str) – Action to check for their existence.

Returns:

True if the action exists, False otherwise.

Return type:

bool

property plugin_action_names: dict[str, list[str]]

Mapping of plugin names to their actions.

property plugin_names: list[str]

Available plugin names.

prepare_3rd_party_plugin(plugin_name: str) None[source]

Prepare cache for third party plugins.

After that a plugin has been prepared can be load on demand.

Parameters:

plugin_name (str) – Name of the entry point of the plugin.

Subpackages

Submodules