MECO™ API Reference
Public Member Functions | List of all members
mMeco.libs.envPathLib.EnvPath Class Reference

[ CLASS ] - Class to operate on env paths. More...

Inheritance diagram for mMeco.libs.envPathLib.EnvPath:

Public Member Functions

def __init__ (self, path, envType)
 Constructor. More...
 
def path (self)
 Property. More...
 
def envType (self)
 Property. More...
 
def envPackageType (self)
 Property. More...
 
def packages (self)
 Property. More...
 
def isAPackage (self, packageRootPath)
 Check whether given path is a package. More...
 
def hasPackage (self, packageName, checkPackageInfoModule=False)
 Check whether the env path has a package with given packageName. More...
 
def doesPackageHaveAVersion (self, packageName, version)
 Check whether a package has a version. More...
 
def listPackages (self, invokeShouldInitializePackageCallback=False)
 List packages in the env path. More...
 
def listVersionsOfAPackage (self, packageName)
 List versions of the given package. More...
 

Detailed Description

[ CLASS ] - Class to operate on env paths.

Constructor & Destructor Documentation

◆ __init__()

def mMeco.libs.envPathLib.EnvPath.__init__ (   self,
  path,
  envType 
)

Constructor.

Parameters
path[ str | None | in ] - Absolute package path of an environment.
envType[ enum | None | in ] - Value from mMeco.libs.enumLib.EnvType enum class.
Exceptions
N/A
Returns
None - None.

Member Function Documentation

◆ path()

def mMeco.libs.envPathLib.EnvPath.path (   self)

Property.

Exceptions
N/A
Returns
str - Value.

◆ envType()

def mMeco.libs.envPathLib.EnvPath.envType (   self)

Property.

Exceptions
N/A
Returns
enum - A value from mMeco.libs.enumLib.EnvType enum class.

◆ envPackageType()

def mMeco.libs.envPathLib.EnvPath.envPackageType (   self)

Property.

Exceptions
N/A
Returns
enum - A value from mMeco.libs.enumLib.EnvPackageType enum class.

◆ packages()

def mMeco.libs.envPathLib.EnvPath.packages (   self)

Property.

Exceptions
N/A
Returns
list of str | list of dict - Value.

◆ isAPackage()

def mMeco.libs.envPathLib.EnvPath.isAPackage (   self,
  packageRootPath 
)

Check whether given path is a package.

Method checks whether package info module file exists relative to packageRootPath.

Parameters
packageRootPath[ str | None | in ] - Root of a package.
Exceptions
N/A
Returns
str - Absolute path of package info module file.
None - If given packageRootPath is not a package.

◆ hasPackage()

def mMeco.libs.envPathLib.EnvPath.hasPackage (   self,
  packageName,
  checkPackageInfoModule = False 
)

Check whether the env path has a package with given packageName.

If env path wanted to be checked for a versioned package checkPackageInfoModule should be provided False as otherwise this method will check package info module file for non-versioned package.

Parameters
packageName[ str | None | in ] - Name of a package to be checked.
checkPackageInfoModule[ bool | None | in ] - Whether package info module file should be checked.
Exceptions
N/A
Returns
str - Absolute path of the package.
None - If no package with packageName exists in the env.

◆ doesPackageHaveAVersion()

def mMeco.libs.envPathLib.EnvPath.doesPackageHaveAVersion (   self,
  packageName,
  version 
)

Check whether a package has a version.

Parameters
packageName[ str | None | in ] - Name of a package.
version[ str | None | in ] - Version to be checked.
Exceptions
ValueError- If the env package type is not mMeco.libs.enumLib.EnvPackageType.kVersioned.
Returns
str - Absolute root path of the version of the package.
None - If version doesn't exist for packageName.

◆ listPackages()

def mMeco.libs.envPathLib.EnvPath.listPackages (   self,
  invokeShouldInitializePackageCallback = False 
)

List packages in the env path.

Parameters
invokeShouldInitializePackageCallback[ bool | False | in ] - Whether to invoke shouldInitializePackage callback.
Exceptions
N/A
Returns
list of str - If env package type is mMeco.libs.enumLib.EnvPackageType.kNonVersioned.
list of dict - If env package type is mMeco.libs.enumLib.EnvPackageType.kVersioned.

◆ listVersionsOfAPackage()

def mMeco.libs.envPathLib.EnvPath.listVersionsOfAPackage (   self,
  packageName 
)

List versions of the given package.

Parameters
packageName[ str | None | in ] - Name of a package.
Exceptions
ValueError- If the env package type is not mMeco.libs.enumLib.EnvPackageType.kVersioned.
Returns
list of str - Versions.
None - If the env path doesn't have package with given packageName.

The documentation for this class was generated from the following file: