craft_parts.plugins.plugins module¶
Definitions and helpers to handle plugins.
- craft_parts.plugins.plugins.extract_part_properties(data, *, plugin_name)[source]¶
Get common part properties without plugin-specific entries.
- Parameters:
data (
Dict
[str
,Any
]) – A dictionary containing all part properties.plugin_name (
str
) – The name of the plugin.
- Return type:
Dict
[str
,Any
]- Returns:
A dictionary containing only common part properties.
- craft_parts.plugins.plugins.get_plugin(*, part, part_info, properties)[source]¶
Obtain a plugin instance for the specified part.
- Parameters:
part (
Part
) – The part requesting the plugin.part_info (
PartInfo
) – The part information data.properties (
PluginProperties
) – The plugin properties.
- Return type:
- Returns:
The plugin instance.
- craft_parts.plugins.plugins.get_plugin_class(name)[source]¶
Obtain a plugin class given the name.
- Parameters:
name (
str
) – The plugin name.- Return type:
Type
[Plugin
]- Returns:
The plugin class.
- Raises:
ValueError – If the plugin name is invalid.
- craft_parts.plugins.plugins.get_registered_plugins()[source]¶
Return the list of currently registered plugins.
- Return type:
Dict
[str
,Type
[Plugin
]]