PackageBase¶
- class PackageBase¶
- Attributes¶
Returns access to the package attributes definitions specified within the parameter set and the referenced package attribute definition files.
- Returns:
Package attribute interface of the parameter set
- Return type:
- Close()¶
Closes the package. After closing the package it can not be modified/accessed anymore.
- GetActivationCondition()¶
Gets the activation condition for this package.
- Returns:
The expression defining the activation condition
- Return type:
str
- GetDescription()¶
Returns the package description.
- Returns:
Description shown in the package properties
- Return type:
str
- GetFilename()¶
Returns the file name of the package file as absolute path, if this is a file. If not it may be unsaved.
- Returns:
The file name of the saved file or None, if not a file
- Return type:
str
- GetMapping()¶
Returns the local mapping of the package.
- Returns:
Mapping of the package
- Return type:
- GetName()¶
Returns the package name.
- Returns:
Package name.
- Return type:
str
- GetParameterVariables()¶
Returns a list of all variables defined in the analysis package and set as a parameter.
- Returns:
List of all defined parameters
- Return type:
list[
Variable]
- GetReturnVariables()¶
Returns a list of all variables defined in the package and set as a return variable.
- Returns:
List of all defined return variables
- Return type:
list[
Variable]
- GetTestScriptId()¶
Returns the test script id of the package.
- Returns:
Test script id.
- Return type:
str
- GetType()¶
- Returns the type (class name) of the package, e.g.
“Package”
“AnalysisPackage”
- Returns:
Type (class name) of the package
- Return type:
str
- GetUnusedVariables()¶
Returns the list of unused variables defined in the package.
- Returns:
List of all unused defined variables
- Return type:
list[
Variable]
- GetVariables()¶
Returns a list of all variables defined in the package.
- Returns:
List of all defined variables
- Return type:
list[
Variable]
- GetVersion()¶
Returns the package version.
- Returns:
Version shown in the package properties
- Return type:
str
- HasSpecificationFlag()¶
Returns the state of the specification flag.
- Returns:
True if specification flag is enabled, otherwise False
- Return type:
bool
- HasTestCaseFlag()¶
Returns the state of the test case flag.
- Returns:
True if test case flag is enabled, otherwise False
- Return type:
bool
- IsActivationConditionFulfilled()¶
Evaluates the activation condition defined in the package.
- Returns:
True, if the activation condition is fulfilled.
- Return type:
bool
- Raises:
ApiError – If the activation condition is not evaluable
- RemoveVariable(variableName)¶
Removes a variable from the package.
- Parameters:
- variableName : str¶
Name of variable to be removed
- RenameVariable(oldVarName, newVarName)¶
Renames a existing variable of the package.
-
Save(filename=
None, allowCompatibilityFallback=False)¶ Saves the package. Appends file ending if needed.
- Parameters:
- filename : str¶
File name of the package; Either absolute or relative to the ‘Packages’ directory. Leave out to save the package to its existing file (previously set with
Save()or fromPackageApi.OpenPackage())- allowCompatibilityFallback : bool¶
If True and the workspace compatibility mode is active, a compatibility conflict does not abort saving. Instead, the file is saved in the minimum compatible version. If False and the workspace compatibility mode is active, a compatibility conflict raises an exception. If the workspace compatibility mode is inactive, the argument is ignored.
- SetActivationCondition(expression)¶
Sets the activation condition for this package.
- Parameters:
- expression : str¶
The expression defining the activation condition
- SetDescription(description)¶
Sets the package description.
- Parameters:
- description : str¶
Description to be shown in the package properties
-
SetSpecificationFlag(state=
True)¶ Sets the specification flag.
- Parameters:
- state : bool¶
True to enable, False to disable the specification flag
-
SetTestCaseFlag(state=
True)¶ Sets the test case flag.
- Parameters:
- state : bool¶
True to enable, False to disable the test case flag
- SetTestScriptId(testSriptId)¶
Sets the test script id of the package.
- Parameters:
- testSriptId : str¶
Test script id