The dip.plugins module implements the infrastructure for encapsulating application plugins.
Base class: Model
The ExtensionPoint class is the default implementation of an extension point.
Bind an attribute of an object to the extension point and update it with all contributions made so far.
| Parameters: |
|
|---|
Contribute an object to all bound attributes.
| Parameters: | contribution – is the object to contribute. |
|---|
Base class: Interface
The IExtensionPoint interface defines the API of an extension point.
The list of contributions made.
The identifier of the extension point.
Bind an attribute of an object to the extension point and update it with all contributions made so far.
| Parameters: |
|
|---|
Contribute an object to all bound attributes.
| Parameters: | contribution – is the object to contribute. |
|---|
Base class: Interface
The IPlugin interface defines the API of a plugin.
This is set if the plugin is enabled.
The identifier of the plugin. Two plugins are considered equivalent if their factories have the same identifier, even though the factories themselves are different.
The list of identifiers of plugins that must be enabled before this one can be enabled.
This is called when the plugin is enabled to ask that it configures itself.
| Parameters: | plugin_manager – the plugin manager. |
|---|
Base class: Interface
The IPluginManager interface defines the API of a plugin manager.
The list of extension points.
The list of contributed plugins.
The list of contributed services.
Bind an extension point to an attribute of an object. The attribute must have an append() method.
| Parameters: |
|
|---|
Bind the service for an interface to an attribute of an object.
| Parameters: |
|
|---|
Choose a particular service from a list of possible services.
| Parameters: | services – a list of contributed services to choose from. |
|---|---|
| Returns: | the chosen service or None if one wasn’t chosen. |
Contribute an object to an extension point.
| Parameters: |
|
|---|
Get a service for a particular interface.
| Parameters: | interface – is the interface. |
|---|---|
| Returns: | the service which will implement or be able to be adapted to the interface. An exception is raised if there is no service available. |
Base class: Singleton
The PluginManager class is a singleton that provides access to a default plugin manager.
The plugin manager instance.
Add a plugin to the plugin manager.
| Parameters: | plugin – is the plugin. |
|---|