OEParameter

class OEParameter

The OEParameter is an abstract base class. The parameters represent indivudual options in a OEOptions class, that can eventually translate to a parameter in a command-line interface application.

The OEParameter class defines the following public methods:
The following classes derive from this class:

AddAlias

AddAlias(alias: str) -> bool

Adds an ‘alias’ name for this parameter. The alias must be a single word and begin with a '-'. This function returns true if the alias is valid and the add succeeds.

AddDetail

AddDetail(detail: str) -> bool

Adds a line to the detailed description of the parameter. Return true if completed successfully.

AddIllegalRange

AddIllegalRange(hi: str, low: str) -> bool

Adds an illegal range for this parameter in string format. This function succeeds and returns true if the parameter can have illegal ranges.

AddIllegalValue

AddIllegalValue(val: str) -> bool

Adds an illegal value in string format. This function succeeds and returns true if the parameter can have illegal values.

AddLegalRange

AddLegalRange(hi: str, low: str) -> bool

Adds a legal range for the parameter in string format. This function succeeds and returns true if the parameter can have legal ranges.

AddLegalValue

AddLegalValue(val: str) -> bool

Adds a legal value in string format. This function succeeds and returns true if the parameter can have legal values.

AddStringDefault

AddStringDefault(value: str) -> bool

Adds a default value in string format. This function succeeds and returns true if the default value can be set.

AddStringValue

AddStringValue(value: str) -> bool

Adds a value for the parameter in string format. This function succeeds and returns true if the value can be set.

ClearDefaults

ClearDefaults() -> bool

Clear all currently set default values. Returns true if done successfully.

ClearValues

ClearValues() -> bool

Clear all currently set parameter values. Returns true if done successfully.

CreateCopy

CreateCopy() -> OEParameter

Creates a copy of this OEParameter instance.

GetAliases

GetAliases() -> Iterable[str]

See AddAlias method.

GetBrief

GetBrief() -> str

See SetBrief method.

GetDetail

GetDetail() -> Iterable[str]

See AddDetail method.

GetHasDefault

GetHasDefault(idx: int = 0) -> bool

Returns true if a default value for the parameter is set.

GetHasValue

GetHasValue(idx: int = 0) -> bool

Returns true if the value of the OEParameter object is set.

GetIllegalRanges

GetIllegalRanges() -> Iterable[Tuple[str,str]]

See AddIllegalRange method.

GetIllegalValues

GetIllegalValues() -> Iterable[str]

See AddIllegalValue method.

GetIsList

GetIsList() -> bool

See SetIsList method.

GetKeyless

GetKeyless() -> int

See SetKeyless method.

GetLegalRanges

GetLegalRanges() -> Iterable[Tuple[str,str]]

Returns the legal ranges in string format.

GetLegalValues

GetLegalValues() -> Iterable[str]

Returns the legal values of the parameter in string format.

GetPrettyLegalValues

GetPrettyLegalValues() -> Iterable[str]

Returns the named legal values of the parameter in string format. This list of legal values may or may-not be idential to the one obtained from GetLegalValues, depending on the parameter type.

GetName

GetName() -> str

See SetName method.

GetOrderPriority

GetOrderPriority() -> int

See SetOrderPriority method.

GetRequired

GetRequired() -> bool

See SetRequired method.

GetStringDefault

GetStringDefault(idx: int = 0) -> str

Returns the string default of the parameter at the specified index. See AddStringDefault method.

GetStringDefaults

GetStringDefaults() -> Iterable[str]

See AddStringDefault method.

GetStringValue

GetStringValue(idx: int = 0) -> str

Returns the string value of the parameter at the specified index. See AddStringValue method.

GetStringValues

GetStringValues() -> Iterable[str]

See AddStringValue method.

GetVisibility

GetVisibility() -> int

See SetVisibility method.

IsLegalString

IsLegalString(value: str) -> bool

Returns if the specified value in the string format is a legal value. A setting is considered a legal value if it does not match and illegal value or fall within an illegal range (see OEParameter.AddIllegalValue and OEParameter.AddIllegalRange member functions of this class). Additionally if the parameter has at least one legal value or legal range the setting must match either a legal value or legal range.

IsSet

IsSet(idx: int = 0) -> bool

Returns if the parameter current contains a setting, i.e., a default or an user-defined value.

IsSetToString

IsSetToString(val: str) -> bool

Returns if the parameters current setting (i.e., a default or an user-defined value) matches the specified string value.

Load

Load() -> bool

Converts the string defaults and values of this parameter into actual defaults and values. This function will return false if the string defaults or values cannot be converted to the actual defaults or values, as well as if the values do not satisfy the specified ranges.

LoadDefault

LoadDefault() -> bool

Converts the string defaults of this parameter into actual defaults. This function will return false if the string defaults cannot be converted to the actual defaults, as well as if the default values do not satisfy the specified ranges.

LoadValue

LoadValue() -> bool

Converts the user-defined string values of this parameter into actual values. This function will return false if the string values cannot be converted to the actual values, as well as if the values do not satisfy the specified ranges.

SetBrief

SetBrief(brief: str) -> bool

Sets the brief description of the parameter.

SetIsList

SetIsList(isList: bool) -> bool

Set if the parameter is a list parameter, i.e., if the parameters can value of list of defaults or user-defined values. Default: False

SetKeyless

SetKeyless(keyless: int) -> bool

Sets the keyless setting of the parameter. To enable a prrameter to be keyless the entry must be a non-zero value. A value of 0 (default) specifies the parameter to be not-keyless. Default: 0

SetName

SetName(name: str) -> bool

Sets the name of the parameter, which must be a single word and begin with '-'.

SetOrderPriority

SetOrderPriority(order: int) -> bool

Sets the order priority of the parameter, which is used to control the order parameters appear in help lists. Default: 0

SetRequired

SetRequired(required: bool) -> bool

Sets the flag indicating if the parameter is required (i.e., must be guven a user-defined value). Default: False

SetStringDefault

SetStringDefault(value: str) -> bool

Sets the default value of the parameter as a string. This string default is not converted into the read default until the OEParameter.LoadDefault member function is called. Default: None

SetStringValue

SetStringValue(value: str) -> bool

Sets the value of the parameter as a string. This string value is not converted into the real value until the OEParameter.LoadValue member function is called. Default: None

SetVisibility

SetVisibility(visibility: int) -> bool

Sets the visibility of the parameter. Valid settings are defined in the OEParamVisibility namespace. ** Default OEParamVisibility_Simple **