tuxemon.plugin module
- class tuxemon.plugin.PluginManager[source]
Bases:
object
Yapsy semi-compatible plugin manager.
- tuxemon.plugin.get_available_classes(plugin_manager, *, interface)[source]
Gets the available classes in a plugin manager.
- Parameter:
plugin_manager: Plugin manager with modules already loaded. interface: Superclass or protocol of the returned classes.
- Returns:
Sequence of loaded classes.
- Parameters:
plugin_manager (PluginManager) –
interface (Type[InterfaceValue]) –
- Return type:
Sequence[Type[InterfaceValue]]
- tuxemon.plugin.load_directory(plugin_folder)[source]
Loads and imports a directory of plugins.
- Parameters:
plugin_folder (str) – The folder where to look for plugin files.
- Returns:
A plugin manager, with the modules already loaded.
- Return type:
- tuxemon.plugin.load_plugins(path: str, category: str = 'plugins') Mapping[str, Type[PluginObject]] [source]
- tuxemon.plugin.load_plugins(path: str, category: str = 'plugins', *, interface: Type[InterfaceValue]) Mapping[str, Type[InterfaceValue]]
Load classes using plugin system.
- Parameters:
path – Location of the modules to load.
category – Optional string for debugging info.
interface – Superclass or protocol of the returned classes. If no class is given, they are only required to have a name attribute.
- Returns:
A dictionary mapping the name attribute of each class to the class itself.