graviti.portex.package#
Package related class.
Module Contents#
Classes#
The base class of Portex package. |
|
The builtin Portex package used to manage builtin types. |
|
The local Portex package used to manage local types. |
|
The external Portex package used to manage external types. |
|
The subset of Portex package, used in |
|
The package manager to manage different Portex packages. |
|
The imports of the Portex template type. |
Attributes#
- class graviti.portex.package.Package[source]#
Bases:
graviti.utility.AttrDict[_T]The base class of Portex package.
- class graviti.portex.package.BuiltinPackage[source]#
Bases:
Package[Type[graviti.portex.builtin.PortexBuiltinType]]The builtin Portex package used to manage builtin types.
- class graviti.portex.package.LocalPackage[source]#
Bases:
Package[Type[graviti.portex.base.PortexType]]The local Portex package used to manage local types.
- class graviti.portex.package.ExternalPackage(url, revision)[source]#
Bases:
Package[Type[graviti.portex.external.PortexExternalType]]The external Portex package used to manage external types.
- Parameters
url (str) – The git repo url of the external package.
revision (str) – The git repo revision (tag/commit) of the external package.
- class graviti.portex.package.Subpackage(package)[source]#
Bases:
graviti.utility.UserMapping[str,Type[graviti.portex.external.PortexExternalType]]The subset of Portex package, used in
Imports.- Parameters
package (ExternalPackage) – The source package of this subpackage.
- classmethod from_pyobj(cls, content)[source]#
Create
Subpackageinstance from python dict.- Parameters
content (Dict[str, Any]) – A python dict representing a subpackage.
- Returns
A
Subpackageinstance created from the input python dict.- Return type
- to_pyobj(self)[source]#
Dump the instance to a python dict.
- Returns
A python dict representation of the
Subpackageinstance.- Return type
Dict[str, Any]
- class graviti.portex.package.Packages[source]#
The package manager to manage different Portex packages.
- class graviti.portex.package.Imports[source]#
Bases:
Mapping[str,Type[graviti.portex.base.PortexType]],graviti.utility.ReprMixinThe imports of the Portex template type.
- Parameters
package – The package the portex belongs to.
- to_pyobj(self)[source]#
Dump the instance to a python list.
- Returns
A python list representation of the Portex imported types.
- Return type
List[Dict[str, Any]]
- add_subpackage(self, subpackage)[source]#
Add subpackage to this
Importsinstance.- Parameters
subpackage (Subpackage) – The subpackage which needs to be added.
- Raises
KeyError – When there are duplicate names in the
importsinstance.- Return type
None