set_plugin

glotaran.plugin_system.base_registry.set_plugin(plugin_register_key: str, full_plugin_name: str, plugin_registry: MutableMapping[str, _PluginType], plugin_register_key_name: str = 'format_name') None[source]

Set a plugins short name to a specific plugin referred by its full name.

This can be used to ensure that a specific plugin is used in case there are conflicting plugins installed.

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

  • full_plugin_name (str) – Full name (import path) of the registered plugin.

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

  • plugin_register_key_name (str) – Name of the arg passed plugin_register_key in the function that implements set_plugin.

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

  • ValueError – If there isn’t a registered plugin with the key full_plugin_name.