Special argument class to hold steering information.
More...
|
def | value (self) |
| Return argument value. More...
|
|
def | dumpvalue (self) |
|
def | prodsysDescription (self) |
|
def | value (self, value) |
|
def | returnMyValue (self, name=None, substep=None, first=False, exe=None) |
| Return the value of this substep arg for an executor with the given parameters. More...
|
|
def | isRunarg (self) |
| Return runarg status. More...
|
|
def | name (self) |
| Name getter. More...
|
|
def | name (self, value) |
| Name setter. More...
|
|
def | __str__ (self) |
| String conversion of our value. More...
|
|
def | __repr__ (self) |
| Repr conversion of our value. More...
|
|
def | __eq__ (self, other) |
| Comparison is based on value attribute. More...
|
|
def | __nq__ (self, other) |
|
def | __lt__ (self, other) |
|
def | __gt__ (self, other) |
|
Special argument class to hold steering information.
Definition at line 2289 of file trfArgClasses.py.
◆ __eq__()
def python.trfArgClasses.argument.__eq__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
|
inherited |
Comparison is based on value attribute.
Definition at line 161 of file trfArgClasses.py.
161 def __eq__(self,other):
162 return self.value == other.value
◆ __gt__()
def python.trfArgClasses.argument.__gt__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
|
inherited |
Definition at line 170 of file trfArgClasses.py.
170 def __gt__(self, other):
171 return self.value > other.value
◆ __lt__()
def python.trfArgClasses.argument.__lt__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
|
inherited |
Definition at line 167 of file trfArgClasses.py.
167 def __lt__(self, other):
168 return self.value < other.value
◆ __nq__()
def python.trfArgClasses.argument.__nq__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
|
inherited |
Definition at line 164 of file trfArgClasses.py.
164 def __nq__(self, other):
165 return self.value != other.value
◆ __repr__()
def python.trfArgClasses.argument.__repr__ |
( |
|
self | ) |
|
|
inherited |
◆ __str__()
def python.trfArgClasses.argument.__str__ |
( |
|
self | ) |
|
|
inherited |
◆ _parseSetterString()
def python.trfArgClasses.argSubstepSteering._parseSetterString |
( |
|
self, |
|
|
|
string |
|
) |
| |
|
private |
Definition at line 2377 of file trfArgClasses.py.
2377 def _parseSetterString(self, string):
2378 if string
in argSubstepSteering.steeringAlises:
2379 return argSubstepSteering.steeringAlises[string]
◆ _parseSteeringString()
def python.trfArgClasses.argSubstepSteering._parseSteeringString |
( |
|
self, |
|
|
|
ivalue |
|
) |
| |
|
private |
Definition at line 2381 of file trfArgClasses.py.
2381 def _parseSteeringString(self, ivalue):
2383 for subvalue
in ivalue.split(
','):
2384 matchedParts = re.match(
r'(in|out)(\+|\-)([A-Z_]+)$', subvalue)
2385 if not matchedParts:
2386 raise trfExceptions.TransformArgException(trfExit.nameToCode(
'TRF_ARG_CONV_FAIL'),
2387 'Failed to convert string {0!s} to argSubstepSteering'.
format(subvalue))
2388 retvalue.append((matchedParts.group(1), matchedParts.group(2), matchedParts.group(3)))
◆ _parseStringAsSubstep()
def python.trfArgClasses.argSubstep._parseStringAsSubstep |
( |
|
self, |
|
|
|
string |
|
) |
| |
|
privateinherited |
Parse a string for substep:value format.
If the string matches the substep specifier regexp then we return the two parts; if not then the substep is returned as self._defaultSubstep
, with the entire string passed back as the value
- Parameters
-
string | The string which should be parsed |
Reimplemented in python.trfArgClasses.argSubstepList.
Definition at line 1959 of file trfArgClasses.py.
1959 def _parseStringAsSubstep(self, string):
1960 subStepMatch = re.match(
r'([a-zA-Z0-9,]+)' + self._separator +
r'(.*)', string)
1963 subStep = subStepMatch.group(1).
split(
',')
1964 subStepValue = subStepMatch.group(2)
1966 subStep = [self._defaultSubstep]
1967 subStepValue = string
1968 msg.debug(
'Parsed {0} as substep {1}, argument {2}'.
format(string, subStep, subStepValue))
1969 for step
in subStep:
1970 subStepList.append((step, subStepValue))
◆ dumpvalue()
def python.trfArgClasses.argSubstepSteering.dumpvalue |
( |
|
self | ) |
|
Definition at line 2319 of file trfArgClasses.py.
2319 def dumpvalue(self):
2320 return self._dumpvalue
◆ isRunarg()
def python.trfArgClasses.argument.isRunarg |
( |
|
self | ) |
|
|
inherited |
◆ name() [1/2]
def python.trfArgClasses.argument.name |
( |
|
self | ) |
|
|
inherited |
◆ name() [2/2]
def python.trfArgClasses.argument.name |
( |
|
self, |
|
|
|
value |
|
) |
| |
|
inherited |
◆ prodsysDescription()
def python.trfArgClasses.argSubstepSteering.prodsysDescription |
( |
|
self | ) |
|
Reimplemented from python.trfArgClasses.argSubstep.
Definition at line 2323 of file trfArgClasses.py.
2323 def prodsysDescription(self):
2324 desc = {
'type':
'substep',
'substeptype':
'steering',
'listtype':
'str',
'separator': self._separator,
2325 'default': self._defaultSubstep}
◆ returnMyValue()
def python.trfArgClasses.argSubstep.returnMyValue |
( |
|
self, |
|
|
|
name = None , |
|
|
|
substep = None , |
|
|
|
first = False , |
|
|
|
exe = None |
|
) |
| |
|
inherited |
Return the value of this substep arg for an executor with the given parameters.
- Parameters
-
name | Executor name |
substep | Executor substep nickname |
first | Boolean flag set true if this is the first executor in the chain |
exe | Executor instance, from which 'name', 'substep' and 'first' can be taken.
|
Definition at line 1979 of file trfArgClasses.py.
1979 def returnMyValue(self, name=None, substep=None, first=False, exe=None):
1982 substep = exe.substep
1983 first = exe.conf.firstExecutor
1989 if name
in self._value:
1990 value = self._value[name]
1991 elif substep
in self._value:
1992 value = self._value[substep]
1993 elif first
and 'first' in self._value:
1994 value = self._value[
'first']
1995 elif 'default' in self._value:
1996 value = self._value[
'default']
2006 if 'all' in self._value:
2008 value = self._value[
'all']
2009 elif isinstance(value, list):
2010 value = self._value[
'all'] + value
2012 msg.debug(
'From substep argument {myvalue} picked value "{value}" for {name}, {substep}, first={first}'.
format(myvalue=self._value, value=value, name=name, substep=substep, first=first))
◆ value() [1/2]
def python.trfArgClasses.argSubstepSteering.value |
( |
|
self | ) |
|
◆ value() [2/2]
def python.trfArgClasses.argSubstepSteering.value |
( |
|
self, |
|
|
|
value |
|
) |
| |
For strings passed to the setter we expect the format to be substep:{in/out}{+/-}DATATYPE
or to be a steering alias, which is then expanded to the more complex format. This is then cast into a dictionary of tuples {substep: [('in/out', '+/-', DATATYPE), ...], ...}
Reimplemented from python.trfArgClasses.argSubstep.
Definition at line 2332 of file trfArgClasses.py.
2332 def value(self, value):
2333 msg.debug(
'Attempting to set argSubstepSteering from {0!s} (type {1})'.
format(value,
type(value)))
2336 self._dumpvalue = [
""]
2337 elif isinstance(value, dict):
2339 for k, v
in value.items():
2340 if not isinstance(k, str)
or not isinstance(v, list):
2341 raise trfExceptions.TransformArgException(trfExit.nameToCode(
'TRF_ARG_CONV_FAIL'),
2342 'Failed to convert dict {0!s} to argSubstepSteering'.
format(value))
2344 if not isinstance(subv, (list, tuple))
or len(subv) != 3
or subv[0]
not in (
'in',
'out')
or subv[1]
not in (
'+',
'-'):
2345 raise trfExceptions.TransformArgException(trfExit.nameToCode(
'TRF_ARG_CONV_FAIL'),
2346 'Failed to convert dict {0!s} to argSubstepSteering'.
format(value))
2352 self._dumpvalue = getattr(self,
"_dumpvalue", value)
2353 elif isinstance(value, (str, list, tuple)):
2354 if isinstance(value, str):
2356 self._dumpvalue = getattr(self,
"_dumpvalue", value)
2360 if not isinstance(item, str):
2361 raise trfExceptions.TransformArgException(trfExit.nameToCode(
'TRF_ARG_CONV_FAIL'),
2362 'Failed to convert list item {0!s} to substep (should be a string)'.
format(item))
2363 if item
in argSubstepSteering.steeringAlises:
2364 msg.debug(
"Found value {0} in steeringAlises ({1})".
format(item, argSubstepSteering.steeringAlises[item]))
2365 for substep, steerlist
in argSubstepSteering.steeringAlises[item].
items():
2366 if substep
in self._value:
2367 self._value[substep].extend(steerlist)
2369 self._value[substep] = steerlist
2371 subStepList = self._parseStringAsSubstep(item)
2372 self._value.
update(dict([(subStep[0], self._parseSteeringString(subStep[1]))
for subStep
in subStepList]))
2374 raise trfExceptions.TransformArgException(trfExit.nameToCode(
'TRF_ARG_CONV_FAIL'),
2375 'Setter value {0!s} (type {1}) for substep argument cannot be parsed'.
format(value,
type(value)))
◆ _defaultSubstep
python.trfArgClasses.argSubstep._defaultSubstep |
|
privateinherited |
◆ _dumpvalue
python.trfArgClasses.argSubstepSteering._dumpvalue |
|
private |
◆ _name
python.trfArgClasses.argument._name |
|
privateinherited |
◆ _runarg
python.trfArgClasses.argument._runarg |
|
privateinherited |
◆ _separator
python.trfArgClasses.argSubstep._separator |
|
privateinherited |
◆ _value
python.trfArgClasses.argSubstepSteering._value |
|
private |
◆ steeringAlises
python.trfArgClasses.argSubstepSteering.steeringAlises |
|
static |
◆ value
python.trfArgClasses.argument.value |
|
inherited |
- Note
- We have a default of None here, but all derived classes should definitely have their own value setter and translate this value to something sensible for their underlying value type. N.B. As most argument classes use this default constructor it must call the
@value
.setter function!
Definition at line 118 of file trfArgClasses.py.
The documentation for this class was generated from the following file: