The dip.plugins module implements the infrastructure for encapsulating application plugins.
Base class: List
The ContributionTo class encapsulates a list of contributions to an extension point as an attribute of a plugin. The value is normally set using a computed default value.
Initialise the object.
Parameters: |
|
---|
Create a clone of this instance with a different default value.
Parameter: | default – is the default value of the cloned instance. |
---|---|
Returns: | the cloned instance. |
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 a list of objects to all bound attributes.
Parameter: | contributions – is the list of objects to contribute. |
---|
Base class: Interface
The IExtensionPoint interface defines the API 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 a list of objects to all bound attributes.
Parameter: | contributions – is the list of objects to contribute. |
---|
Base class: Interface
The IPlugin interface defines the API of a plugin.
Bind an extension point to the attribute of an object. The attribute must have an append() method.
Parameters: |
|
---|
Get a service that implements a particular interface.
Parameter: | interface – is the interface that the service must implement. |
---|---|
Returns: | the service. An exception is raised if there is no service available. |
Base class: Interface
The IPluginManager interface defines the API of a plugin manager.
Bind an extension point to the attribute of an object. The attribute must have an append() method.
Parameters: |
|
---|
Choose a particular service from a list of possible services.
Parameters: |
|
---|---|
Returns: | the chosen service or None if one wasn’t chosen. |
Contribute some objects to an extension point.
Parameters: |
|
---|
Get a service that implements a particular interface.
Parameter: | interface – is the interface that the service must implement. |
---|---|
Returns: | the service. An exception is raised if there is no service available. |
Base class: Model
The Plugin class is a convenience base class for a plugin.
Bind an extension point to the attribute of an object. The attribute must have an append() method.
Parameters: |
|
---|
This is called when the plugin is enabled to return an iterator of 2-tuples of the extension point identifier and the list of contributions to the extension point. This default implementation looks for any ContributionTo attributes in the plugin and its super-classes.
Returns: | the iterator. |
---|
Get a service that implements a particular interface.
Parameter: | interface – is the interface that the service must implement. |
---|---|
Returns: | the service. An exception is raised if there is no service available. |
Base class: Model
The PluginManager class is the default implementation of the IPluginManager interface.
Bind an extension point to the attribute of an object. The attribute must have an append() method.
Parameters: |
|
---|
Choose a particular service from a list of possible services.
Parameters: |
|
---|---|
Returns: | the chosen service or None if one wasn’t chosen. |
Contribute some objects to an extension point.
Parameters: |
|
---|
Get a service that implements a particular interface.
Parameter: | interface – is the interface that the service must implement. |
---|---|
Returns: | the service. An exception is raised if there is no service available. |