Plugins

Utility functions for handling plugins, eg. importing, downloading, listing, confirming, etc.

Functions:

import_plugins([plugin_dir])

Import all plugins in the plugin (or supplied) directory.

unload_plugins()

Un-import imported plugins (mostly for testing purposes)

list_wiki_plugins()

List plugins available on the wiki using utils.wiki.ask()

import_plugins(plugin_dir: Optional[pathlib.Path] = None) dict[source]

Import all plugins in the plugin (or supplied) directory.

There is no specific form for a plugin at the moment, so this function will recursively import all modules and packages within the directory.

Plugins can then be accessed by the get() registry functions.

Parameters

plugin_dir (None, pathlib.Path) – Directory to import. if None (default), use prefs.get('PLUGINDIR').

Returns

of imported objects with form {“class_name”: class_object}

Return type

dict

unload_plugins()[source]

Un-import imported plugins (mostly for testing purposes)

list_wiki_plugins()[source]

List plugins available on the wiki using utils.wiki.ask()

Returns

{‘plugin_name’: {‘plugin_prop’:’prop_value’,…}

Return type

dict