OSFI-Python
3.10.0
OpenSF Integration Library
|
Public Member Functions | |
def | __init__ (self, str name, str description, typing.Union[str, ParamType] elType, typing.Union[str, 'ArrayNode'] value, typing.Sequence[int] aDims=(), str aUnits='', str aMin='', str aMax='', typing.Optional[typing.Union[str, 'ParamComplexType']] aParamComplexType=None) |
def | write (self) |
def | getRawValue (self) |
def | getValue (self, typing.Optional[ParamType] asType=None) |
def | getIntValue (self) |
def | getDoubleValue (self) |
def | getBooleanValue (self) |
def | getStringValue (self) |
def | getFileValue (self) |
def | getTimeValue (self) |
def | getVectorBoolean (self) |
def | getVectorString (self) |
def | getVectorFile (self) |
def | getVectorDouble (self) |
def | getVectorInt (self) |
def | getVectorTime (self) |
def | getMatrixDouble (self) |
def | getMatrixInt (self) |
def | getMatrixString (self) |
def | getMatrixBoolean (self) |
def | getMatrixFile (self) |
def | getMatrixTime (self) |
def | getArrayValue (self, *int indices, typing.Optional[ParamType] asType=None) |
typing.List[typing.List[bool]] | fileExists (self) |
def | setValue (self, str aValue) |
int | getNdims (self) |
typing.Sequence[int] | getDims (self) |
def | getName (self) |
str | getLocalName (self) |
str | getPath (self) |
str | getDescription (self) |
str | getUnits (self) |
str | getMin (self) |
def | geMax (self) |
str | getMax (self) |
str | getType (self) |
def | getParamType (self) |
ParamType | getElementType (self) |
'ParamComplexType' | getParamComplexType (self) |
str | cleanString (self, str string) |
typing.Sequence[str] | splitValues (self, str string) |
Static Public Member Functions | |
def | getFileFormattedValue (fileName) |
bool | FileExists (filename) |
This class encapsulates every element of information from the configuration file. <p>A parameter is a self-describing element that couples a name and a value, describing its contents and adding syntactic and semantic constraints.</p>
def OSFI.Parameter.Parameter.__init__ | ( | self, | |
str | name, | ||
str | description, | ||
typing.Union[str, ParamType] | elType, | ||
typing.Union[str, 'ArrayNode'] | value, | ||
typing.Sequence[int] | aDims = () , |
||
str | aUnits = '' , |
||
str | aMin = '' , |
||
str | aMax = '' , |
||
typing.Optional[typing.Union[str, 'ParamComplexType']] | aParamComplexType = None |
||
) |
<p>Complete constructor.</p> @param name Name, includoing the full path @param description Description. @param type Type. See ParamType. Either a ParamType value or a string can be used @param value Value. May be a string or, for ARRAY parameters, an ArrayNode @param aDims Dimensions sizes. List or tuple of integers. @param aUnits Units. Blank or "-" for unitless parameters. @param aMin Minimum valid value. @param aMax Maximum valid value. @param aParamComplexType ParamComplexType One of the following options:: NONE, ARRAY, MATRIX
References OSFI.Parameter.Parameter.__description, OSFI.Parameter.Parameter.__dims, OSFI.Parameter.Parameter.__max, OSFI.Parameter.Parameter.__min, OSFI.Parameter.Parameter.__name, OSFI.Parameter.Parameter.__paramComplexType, OSFI.Parameter.Parameter.__type, OSFI.Parameter.Parameter.__units, and OSFI.Parameter.Parameter.__value.
str OSFI.Parameter.Parameter.cleanString | ( | self, | |
str | string | ||
) |
<p>Replaces "," and multiple empty spaces with one space.</p> @return string.
|
static |
<p> Checks if a file is found within the file system </p> @param filename @return True if file exists
typing.List[typing.List[bool]] OSFI.Parameter.Parameter.fileExists | ( | self | ) |
<p>Check the existence of the files specified within a FILE parameter</p> <p>Not valid for ARRAY type.</p> Note: When the parameter value is a single file name, returns a 1x1 list When the parameter value is a vector of file names, returns a 1xN list @return A matrix with a boolean for each file TRUE -> file found, FALSE ->file not found A file is considered found when it is correctly located and ready to be read.
References OSFI.Parameter.Parameter.__paramComplexType, OSFI.Parameter.Parameter.getDims(), OSFI.Parameter.Parameter.getFileValue(), OSFI.Parameter.Parameter.getMatrixFile(), and OSFI.Parameter.Parameter.getVectorFile().
def OSFI.Parameter.Parameter.geMax | ( | self | ) |
@deprecated see #getMax()
References OSFI.Parameter.Parameter.getMax().
def OSFI.Parameter.Parameter.getArrayValue | ( | self, | |
*int | indices, | ||
typing.Optional[ParamType] | asType = None |
||
) |
Returns the parsed value of an ARRAY parameter as a structure of nested lists. Each dimension corresponds to a level of nesting, and lists may have different sizes due to the inhomogeneous nature of ARRAY parameters. If positional arguments are provided, they are indices into the parameter, so the following: v = p.getArrayValue(1,0) is equivalent to: v = p.getArrayValue()[1][0] with the exception that in the former call only the relevant part of the tree is parsed.
References OSFI.Parameter.Parameter.__name, OSFI.Parameter.Parameter.__type, and OSFI.Parameter.Parameter.__value.
def OSFI.Parameter.Parameter.getBooleanValue | ( | self | ) |
<p>Gets the value of the parameter as a boolean type.</p> <p>Valid when there is only one value.</p> @return TRUE if value = "TRUE", or None if the parse fails
References OSFI.Parameter.Parameter.__parseValAsScalar().
str OSFI.Parameter.Parameter.getDescription | ( | self | ) |
<p>Gets a brief description of the parameters.</p> @return string with the description.
References OSFI.Parameter.Parameter.__description.
typing.Sequence[int] OSFI.Parameter.Parameter.getDims | ( | self | ) |
<p>Gets a vector with the size of the dimensions.</p> @return Vector with dimension sizes.
References OSFI.Parameter.Parameter.__dims.
def OSFI.Parameter.Parameter.getDoubleValue | ( | self | ) |
<p>Gets the value of the parameter as a double type.</p> <p>Valid when there is only one value.</p> @return Parameter value as double, or None if the parse fails
References OSFI.Parameter.Parameter.__parseValAsScalar().
ParamType OSFI.Parameter.Parameter.getElementType | ( | self | ) |
Returns the type of individual components of this parameter, as a ParamType instance. See also getType.
References OSFI.Parameter.Parameter.__paramComplexType, and OSFI.Parameter.Parameter.__type.
|
static |
<p>Gets the value of the parameter as an array of characters.</p> <p>Checks the fileName validity</p> @param fileName String where fileName path name is stored @return Parameter value as array of characters.
def OSFI.Parameter.Parameter.getFileValue | ( | self | ) |
<p>Gets the value of the parameter as a file.</p> <p>Checks the file validity</p> @return Parameter value as a string, or None if the parse fails
References OSFI.Parameter.Parameter.__parseValAsScalar().
def OSFI.Parameter.Parameter.getIntValue | ( | self | ) |
<p>Gets the value of the parameter as an integer type.</p> <p>Valid when there is only one value.</p> @return Parameter value as integer, or None if the parse fails
References OSFI.Parameter.Parameter.__parseValAsScalar().
str OSFI.Parameter.Parameter.getLocalName | ( | self | ) |
The name of the parameter, only the local part after the last group
References OSFI.Parameter.Parameter.__name.
def OSFI.Parameter.Parameter.getMatrixBoolean | ( | self | ) |
<p>Gets the value of the parameter as a dynamic matrix of boolean values.</p> <p>Not valid for ARRAY type.</p> @return Value as matrix of booleans.
References OSFI.Parameter.Parameter.__parseValAsMatrix().
def OSFI.Parameter.Parameter.getMatrixDouble | ( | self | ) |
<p>Gets the value of the parameter as a dynamic matrix of double values.</p> <p>Not valid for ARRAY type.</p> @return Value as matrix of doubles.
References OSFI.Parameter.Parameter.__parseValAsMatrix().
def OSFI.Parameter.Parameter.getMatrixFile | ( | self | ) |
<p>Gets the value of the parameter as a dynamic matrix of file name values.</p> <p>Not valid for ARRAY type.</p> @return Value as matrix of file names.
References OSFI.Parameter.Parameter.__parseValAsMatrix().
def OSFI.Parameter.Parameter.getMatrixInt | ( | self | ) |
<p>Gets the value of the parameter as a dynamic matrix of integer values.</p> <p>Not valid for ARRAY type.</p> @return Value as matrix of integers.
References OSFI.Parameter.Parameter.__parseValAsMatrix().
def OSFI.Parameter.Parameter.getMatrixString | ( | self | ) |
<p>Gets the value of the parameter as a dynamic matrix of string values.</p> <p>Not valid for ARRAY type.</p> @return Value as matrix of string.
References OSFI.Parameter.Parameter.__parseValAsMatrix().
def OSFI.Parameter.Parameter.getMatrixTime | ( | self | ) |
<p>Gets the value of the parameter as a dynamic matrix of timecode values.</p> <p>Not valid for ARRAY type.</p> @return Value as matrix of timecodes.
References OSFI.Parameter.Parameter.__parseValAsMatrix().
str OSFI.Parameter.Parameter.getMax | ( | self | ) |
<p>Gets the maximum value of the parameters.</p> @return string with the maximum value.
References OSFI.Parameter.Parameter.__max.
str OSFI.Parameter.Parameter.getMin | ( | self | ) |
<p>Gets the minimum value of the parameters.</p> @return string with the minimum value.
References OSFI.Parameter.Parameter.__min.
def OSFI.Parameter.Parameter.getName | ( | self | ) |
<p>Gets the name of the parameter.</p> @return string with the parameter name.
References OSFI.Parameter.Parameter.getPath().
int OSFI.Parameter.Parameter.getNdims | ( | self | ) |
<p>Gets the number of dimensions.</p> @return Dimensions number.
References OSFI.Parameter.Parameter.__dims.
def OSFI.Parameter.Parameter.getParamType | ( | self | ) |
Deprecated in favour of the uniform name getElementType
References OSFI.Parameter.Parameter.getElementType().
str OSFI.Parameter.Parameter.getPath | ( | self | ) |
The full path of the parameter, including the group names.
References OSFI.Parameter.Parameter.__name.
def OSFI.Parameter.Parameter.getRawValue | ( | self | ) |
Returns the unparsed parameter value, as a string.
References OSFI.Parameter.Parameter.__value.
def OSFI.Parameter.Parameter.getStringValue | ( | self | ) |
<p>Gets the value of the parameter as a string type.</p> @return Parameter value as string, or None if the parse fails
References OSFI.Parameter.Parameter.__parseValAsScalar().
def OSFI.Parameter.Parameter.getTimeValue | ( | self | ) |
<p>Gets the value of the parameter as a timecode.</p> <p>Valid when there is only one value.</p> @return Parameter value as a timecode, or None if the parse fails
References OSFI.Parameter.Parameter.__parseValAsScalar(), and OSFI.Parameter.Parameter.__value.
str OSFI.Parameter.Parameter.getType | ( | self | ) |
<p>Gets the type of the parameter.</p> @return String with the type of the parameter.
References OSFI.Parameter.Parameter.__type.
str OSFI.Parameter.Parameter.getUnits | ( | self | ) |
<p>Gets the units of the parameters.</p> @return string with the minimum value.
References OSFI.Parameter.Parameter.__units.
def OSFI.Parameter.Parameter.getValue | ( | self, | |
typing.Optional[ParamType] | asType = None |
||
) |
Returns the parsed value of the parameter.
References OSFI.Parameter.Parameter.__dims, OSFI.Parameter.Parameter.__parseSingleValAs(), OSFI.Parameter.Parameter.__parseValAsMatrix(), OSFI.Parameter.Parameter.__parseValAsScalar(), OSFI.Parameter.Parameter.__parseValAsVector(), OSFI.Parameter.Parameter.__type, OSFI.Parameter.Parameter.__value, and OSFI.Parameter.Parameter.getArrayValue().
def OSFI.Parameter.Parameter.getVectorBoolean | ( | self | ) |
<p>Gets the value of the parameter as a vector of booleans.</p> @return Parameter value as a vector of booleans.
References OSFI.Parameter.Parameter.__parseValAsVector().
def OSFI.Parameter.Parameter.getVectorDouble | ( | self | ) |
<p>Gets the value of the parameter as a vector of double values.</p> @return Parameter value as a vector of double values.
References OSFI.Parameter.Parameter.__parseValAsVector().
def OSFI.Parameter.Parameter.getVectorFile | ( | self | ) |
<p>Gets the value of the parameter as a vector of file names.</p> @return Parameter value as a vector of file names.
References OSFI.Parameter.Parameter.__parseValAsVector().
def OSFI.Parameter.Parameter.getVectorInt | ( | self | ) |
<p>Gets the value of the parameter as a vector of integer values.</p> @return Parameter value as a vector of integer values.
References OSFI.Parameter.Parameter.__parseValAsVector().
def OSFI.Parameter.Parameter.getVectorString | ( | self | ) |
<p>Gets the value of the parameter as a vector of strings.</p> @return Parameter value as a vector of strings.
References OSFI.Parameter.Parameter.__parseValAsVector().
def OSFI.Parameter.Parameter.getVectorTime | ( | self | ) |
<p>Gets the value of the parameter as a vector of timecodes.</p> @return Parameter value as a vector of timecode values.
References OSFI.Parameter.Parameter.__paramComplexType, OSFI.Parameter.Parameter.__parseSingleValAs(), OSFI.Parameter.Parameter.__parseValAsVector(), OSFI.Parameter.Parameter.__value, and OSFI.Parameter.Parameter.getDims().
def OSFI.Parameter.Parameter.setValue | ( | self, | |
str | aValue | ||
) |
<p>Sets the parameter value as a string.</p> @param aValue Parameter value.
References OSFI.Parameter.Parameter.__value.
typing.Sequence[str] OSFI.Parameter.Parameter.splitValues | ( | self, | |
str | string | ||
) |
Split values by their delimiter ("'" for String types and spaces for the other types) @return String
References OSFI.Parameter.Parameter.__type, and OSFI.Parameter.Parameter.cleanString().
def OSFI.Parameter.Parameter.write | ( | self | ) |
Prints out to standard output a textual description of the parameter.
References OSFI.Parameter.Parameter.__description, OSFI.Parameter.Parameter.__dims, OSFI.Parameter.Parameter.__max, OSFI.Parameter.Parameter.__min, OSFI.Parameter.Parameter.__name, OSFI.Parameter.Parameter.__paramComplexType, OSFI.Parameter.Parameter.__type, OSFI.Parameter.Parameter.__units, and OSFI.Parameter.Parameter.__value.