power_balance.plugins#
Source: power_balance/plugins/__init__.py
Power Balance Models Plugins
Adds support for external plugins, these plugins can provide extra options to the main CLI, as well as setup arguments before they are then read by the main core functionality.
add_plugin_commands#
add_plugin_commands(parent_command: click.core.Group) -> None
Append CLI commands from plugin to main PBM CLI Power Balance Models assumes a plugin is defined by the presence of a plugin metadata file 'plugin.toml'
Parameters#
-
parent_command
:click.core.Group
the main command group to append additional subcommands to
apply_modifications_to#
apply_modifications_to(name: str, function: click.core.Command) -> None
Applies modifications to the given CLI function
extract_commands#
extract_commands(plugin_metadata: Dict) -> List[click.core.Command]
Extracts all commands from a given plugin metadata file
Parameters#
-
plugin_metadata
:typing.Dict
plugin metadata
Returns#
-
typing.List
list of command objects initialised from the definitions
get_plugin_display_filename#
get_plugin_display_filename(plugin_name: str) -> str
Returns the expected display template file for a given plugin
Returns#
str
get_plugin_listing#
get_plugin_listing() -> Dict
Get list of available plugins
Returns#
typing.Dict
install_plugin#
install_plugin(plugin_directory: str) -> None
Install a plugin from a plugin directory
Parameters#
-
plugin_directory
:str
directory containing required PLUGIN_FILE file
prepare_from_plugins#
prepare_from_plugins(pbmmain_call_args: Dict) -> List[str]
Prepare the main method of PBM updating from any plugin modifications
Returns#
typing.List
remove_plugin#
remove_plugin(plugin_name: str) -> None
Uninstall a plugin from the plugins directory
Parameters#
-
plugin_name
:str
name of plugin to remove