add_plugin_to_registry

glotaran.plugin_system.base_registry.add_plugin_to_registry(plugin_register_key: str, plugin: _PluginType, plugin_registry: MutableMapping[str, _PluginType], plugin_set_func_name: str, instance_identifier: str = '') None[source]

Add a plugin with name plugin_register_key to the given registry.

In addition it also adds the plugin with it full import path name as key, which allows for a better reproducibility in case there are conflicting plugins.

Parameters:
  • plugin_register_key (str) – Name of the plugin under which it is registered.

  • plugin (_PluginType) – Plugin to be added to the registry.

  • plugin_registry (MutableMapping[str, _PluginType]) – Registry the plugin should be added to.

  • plugin_set_func_name (str) – Name of the function used to pin a plugin.

  • instance_identifier (str) – Used to differentiate between plugin instances (e.g. different format for IO plugins)

Raises:

ValueError – If plugin_register_key has the character ‘.’ in it.

See also

add_instantiated_plugin_to_register, full_plugin_name