brain_deer.plugins_host.plugin_manager¶
BrainDeer 2.0 plugin discovery / instantiation.
- The Qt UI expects:
discover_plugins()to return plugin idsget_available_plugins()to list discovered idsget_plugin_metadata(plugin_name)to returnPluginMetadatafor cardsinstantiate_plugin(plugin_name, api_instance)to create & initialize a plugin
In 2.0 the previous implementation was a stub that returned no plugins, so the Atlas Browser / leadDBS plugins never appeared in the UI.
Classes¶
Discover and load plugins from |
Functions¶
|
|
Module Contents¶
- brain_deer.plugins_host.plugin_manager.bundled_plugins_dir() pathlib.Path¶
src/brain_deer/plugins— the first-party plugin tree.
- class brain_deer.plugins_host.plugin_manager.PluginManager(plugin_dir: str)¶
Discover and load plugins from
brain_deer/plugins/<id>/plugin.py.- discover_plugins() List[str]¶
Return discovered plugin ids.
A plugin id is the directory name that contains a
plugin.pyfile, e.g.brain_deer/plugins/vr_stream/plugin.py->"vr_stream".Discovery is limited to
_BUNDLED_PLUGIN_ALLOWLISTso stray folders underplugins/do not appear in the UI.
- release_plugin(name: str) None¶
Forget a plugin instance after the UI has torn it down.
Without this,
instantiate_plugin()would return the cached instance on a later open in the same process:cleanup()has already deleted the widget andinitialize()is not run again, so activation fails (e.g. Laminosaurus tab stays empty).
- instantiate_plugin(name: str, api_instance: object) brain_deer.plugin_api.v1.PluginBase | None¶
Instantiate and initialize a plugin for activation in the UI.