Extensions sytem.
Mixin classes ca be applied to objects: "Module", "Class", "Function", "Variable", "Indirection", "Docstring", "Decoration", "Argument", "Location", BUT NOT "TreeRoot".
You create an extension like this:
from pydocspec.ext import VariableMixin, ClassMixin, ApiObjectVisitorExt, AstVisitorExt, ExtRegistrar # define extension logic class MyDataMixin(VariableMixin): ... class MyClassMixin(ClassMixin): ... class MyAstVisitor(AstVisitorExt): ... class MyObjectVisitor(ApiObjectVisitorExt): ... # configure your extension components in the extension system, with this special function # that will be called for each extensions. def setup_extension(r:ExtRegistrar) -> None: r.register_mixins(MyDataMixin, MyClassMixin) r.register_astbuild_visitors(MyAstVisitor) r.register_postbuild_visitors(MyObjectVisitor)
specfactory.Factory
. Because of that, the documentation of the classes listed in this module are incomplete, properties
and methods provided by mixin classes can be review in their respective documentation, under the package pydocspec.ext
.
Notes | |
Tree root instance is created before extensions are loaded. | |
Mixin classes are going to be added to the list of bases when creating the new objects with the |
Package | default |
No package docstring; 1/2 module documented |
Package | opt |
Optional extensions packaged. |
From __init__.py
:
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Encapsulate an astroid inference tip to be registered with the ExtRegistrar . |
Class |
|
Encapsulate an astroid transform to be registered with the ExtRegistrar . |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
The extension registrar interface class. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Function | get |
Get the full names of all the default extension modules included in L{pydocspec}. |
Function | get |
Get the full names of all the default extension modules included in L{pydocspec}. |
Function | load |
Undocumented |
Class | _ |
Base class to customize astroid inference system with a bridge to pydocspec tree. |
Function | _get |
Transform a list of mixins classes to a dict from the concrete class name to the mixins that must be applied to it. |
Function | _get |
Will look for the special function setup_extension in the provided module. |
Function | _get |
Undocumented |
Variable | _mixin |
Undocumented |
Transform a list of mixins classes to a dict from the concrete class name to the mixins that must be applied to it.
This relies on the fact that mixins shoud extend one of the
base mixin classes in pydocspec.ext
module.
Parameters | |
*mixins:Type[ | Undocumented |
Returns | |
Dict[ | Undocumented |
Raises | |
TypeError | If a mixin does not extends any of the provided base mixin classes. |
Will look for the special function setup_extension in the provided module.
Raises ValueError if module do not provide a valid setup_extension() function. Raise ModuleNotFoundError if module is not found.
Returns a tuple(str, callable): extension module name, setup_extension() function.
Parameters | |
module:str | Undocumented |
Returns | |
Callable[ | Undocumented |