Skip to content

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
Source: power_balance/plugins/__init__.py

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
Source: power_balance/plugins/__init__.py

Applies modifications to the given CLI function

extract_commands#

extract_commands(plugin_metadata: Dict) -> List[click.core.Command]
Source: power_balance/plugins/__init__.py

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
Source: power_balance/plugins/__init__.py

Returns the expected display template file for a given plugin

Returns#

  • str

get_plugin_listing#

get_plugin_listing() -> Dict
Source: power_balance/plugins/__init__.py

Get list of available plugins

Returns#

  • typing.Dict

install_plugin#

install_plugin(plugin_directory: str) -> None
Source: power_balance/plugins/__init__.py

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]
Source: power_balance/plugins/__init__.py

Prepare the main method of PBM updating from any plugin modifications

Returns#

  • typing.List

remove_plugin#

remove_plugin(plugin_name: str) -> None
Source: power_balance/plugins/__init__.py

Uninstall a plugin from the plugins directory

Parameters#

  • plugin_name: str

    name of plugin to remove


Last update: April 1, 2022