venv_management.extension module
The plug-in extension mechanism.
Summary
Exceptions:
Raised if there is an error in an extension. |
Classes:
A generic extension point for plug-ins. |
Functions:
Create an instance of a named extension. |
|
A mapping of extension names to extension package paths. |
|
List the names of the extensions available in a given namespace. |
Reference
- exception venv_management.extension.ExtensionError[source]
Bases:
Exception
Raised if there is an error in an extension.
- venv_management.extension.list_extensions(namespace)[source]
List the names of the extensions available in a given namespace.
- venv_management.extension.list_dirpaths(namespace)[source]
A mapping of extension names to extension package paths.
- class venv_management.extension.Extension(name)[source]
Bases:
abc.ABC
A generic extension point for plug-ins.
- property version
The version of the extension.
- venv_management.extension.create_extension(kind, namespace, name, exception_type, *args, **kwargs) venv_management.extension.Extension [source]
Create an instance of a named extension.
- Parameters
kind – The kind of extension to create.
namespace – The namespace within which the extension is a member.
name – The name of the extension.
exception_type – The type of exception to be raised if an extension could not be created.
*args – Positional arguments to forward to the extensions constructor.
**kwargs – Keyword arguments to forward to the extensions constructor.
- Returns
An extension instance.
- Raises
exception_type – If the requested extension could not be located.