spyder.api.plugin_registration.decorators#
Spyder API plugin registration decorators.
Functions
|
Method decorator used to handle plugin availability on Spyder. |
|
Method decorator used to handle plugin teardown on Spyder. |
- spyder.api.plugin_registration.decorators.on_plugin_available(func: Callable = None, plugin: str | None = None)[source]#
Method decorator used to handle plugin availability on Spyder.
The methods that use this decorator must have the following signature: def method(self) when observing a single plugin or def method(self, plugin): … when observing multiple plugins or all plugins that were listed as dependencies.
- Parameters:
func (Callable) – Method to decorate. Given by default when applying the decorator.
plugin (Optional[str]) – Name of the requested plugin whose availability triggers the method.
- Returns:
func – The same method that was given as input.
- Return type:
Callable
- spyder.api.plugin_registration.decorators.on_plugin_teardown(func: Callable = None, plugin: str | None = None)[source]#
Method decorator used to handle plugin teardown on Spyder.
This decorator will be called before the specified plugin is deleted and also before the plugin that uses the decorator is destroyed.
The methods that use this decorator must have the following signature: def method(self).
- Parameters:
func (Callable) – Method to decorate. Given by default when applying the decorator.
plugin (str) – Name of the requested plugin whose teardown triggers the method.
- Returns:
func – The same method that was given as input.
- Return type:
Callable