ATLAS Offline Software
Loading...
Searching...
No Matches
python.trfArgClasses.argList Class Reference

List of string arguments. More...

Inheritance diagram for python.trfArgClasses.argList:
Collaboration diagram for python.trfArgClasses.argList:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self, value=[], supressEmptyStrings=True, splitter=',', runarg=True, name=None)
 List of string arguments.
 value (self)
 Argument value getter.
 prodsysDescription (self)
 value (self, value)
 Argument value setter.
 append (self, addme)
 Append a value to the list.
 __str__ (self)
 String conversion.
 __repr__ (self)
 Repr conversion.
 isRunarg (self)
 Return runarg status.
 name (self)
 Name getter.
 name (self, value)
 Name setter.
 __eq__ (self, other)
 Comparison is based on value attribute.
 __nq__ (self, other)
 __lt__ (self, other)
 __gt__ (self, other)

Protected Attributes

 _splitter = splitter
 _supressEmptyStrings = supressEmptyStrings
 _runarg = runarg
 _name = name
 _value = value

Detailed Description

List of string arguments.

Definition at line 348 of file trfArgClasses.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

python.trfArgClasses.argList.__init__ ( self,
value = [],
supressEmptyStrings = True,
splitter = ',',
runarg = True,
name = None )

List of string arguments.

Argument holding a list of string values

Parameters
splitterThe splitter argument determines how the string is split (default by a comma)
valueInitial value to set (note default is an empty list [])
supressEmptyStringsIf empty strings are removed from the list (Can be used to easily set an empty list from the CLI)

Definition at line 356 of file trfArgClasses.py.

356 def __init__(self, value = [], supressEmptyStrings = True, splitter=',', runarg=True, name=None):
357 self._splitter = splitter
358 self._supressEmptyStrings = supressEmptyStrings
359
360 super(argList, self).__init__(value = value, runarg = runarg, name=name)
361

Member Function Documentation

◆ __eq__()

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
163

◆ __gt__()

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
172

◆ __lt__()

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
169

◆ __nq__()

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
166

◆ __repr__()

python.trfArgClasses.argList.__repr__ ( self)

Repr conversion.

Return a python parsable string

Definition at line 409 of file trfArgClasses.py.

409 def __repr__(self):
410 return '[' + ','.join([ repr(s) for s in self._value ]) + ']'
411
412

◆ __str__()

python.trfArgClasses.argList.__str__ ( self)

String conversion.

Flatten values and space separate

Warning
Values sets with spaces will be confused by this conversion

Definition at line 404 of file trfArgClasses.py.

404 def __str__(self):
405 return " ".join(self._value)
406

◆ append()

python.trfArgClasses.argList.append ( self,
addme )

Append a value to the list.

Parameters
addmeItem to add

Definition at line 398 of file trfArgClasses.py.

398 def append(self, addme):
399 self._value.append(addme)
400

◆ isRunarg()

python.trfArgClasses.argument.isRunarg ( self)
inherited

Return runarg status.

Definition at line 134 of file trfArgClasses.py.

134 def isRunarg(self):
135 return self._runarg
136

◆ name() [1/2]

python.trfArgClasses.argument.name ( self)
inherited

Name getter.

Reimplemented in python.trfArgClasses.argFile, and python.trfArgClasses.argFile.

Definition at line 139 of file trfArgClasses.py.

139 def name(self):
140 return self._name
141

◆ name() [2/2]

python.trfArgClasses.argument.name ( self,
value )
inherited

Name setter.

Reimplemented in python.trfArgClasses.argFile, and python.trfArgClasses.argFile.

Definition at line 144 of file trfArgClasses.py.

144 def name(self, value):
145 self._name = value
146

◆ prodsysDescription()

python.trfArgClasses.argList.prodsysDescription ( self)

Reimplemented from python.trfArgClasses.argument.

Reimplemented in python.trfArgClasses.argAthenaFile, python.trfArgClasses.argBSFile, python.trfArgClasses.argBZ2File, python.trfArgClasses.argFile, python.trfArgClasses.argFTKIPFile, python.trfArgClasses.argHISTFile, python.trfArgClasses.argIntList, python.trfArgClasses.argKeyFloatValueList, python.trfArgClasses.argNTUPFile, and python.trfArgClasses.argPOOLFile.

Definition at line 370 of file trfArgClasses.py.

370 def prodsysDescription(self):
371 desc = {'type' : 'list', 'listtype': 'str'}
372 if self._supressEmptyStrings:
373 desc['supress Empty Strings'] = self._supressEmptyStrings
374 return desc
375
376

◆ value() [1/2]

python.trfArgClasses.argList.value ( self)

Argument value getter.

Returns
Current value

Reimplemented from python.trfArgClasses.argument.

Reimplemented in python.trfArgClasses.argFile, python.trfArgClasses.argFile, python.trfArgClasses.argIntList, python.trfArgClasses.argIntList, python.trfArgClasses.argKeyFloatValueList, and python.trfArgClasses.argKeyFloatValueList.

Definition at line 365 of file trfArgClasses.py.

365 def value(self):
366 return self._value
367

◆ value() [2/2]

python.trfArgClasses.argList.value ( self,
value )

Argument value setter.

If we get a list then set that, otherwise we split a string on the splitter character

Reimplemented from python.trfArgClasses.argument.

Reimplemented in python.trfArgClasses.argFile, python.trfArgClasses.argFile, python.trfArgClasses.argIntList, python.trfArgClasses.argIntList, python.trfArgClasses.argKeyFloatValueList, and python.trfArgClasses.argKeyFloatValueList.

Definition at line 380 of file trfArgClasses.py.

380 def value(self, value):
381 if isinstance(value, (list, tuple)):
382 self._value = list(value)
383 elif value is None:
384 self._value = []
385 return
386 else:
387 try:
388 if self._supressEmptyStrings:
389 self._value = [ v for v in value.split(self._splitter) if v != '' ]
390 else:
391 self._value = value.split(self._splitter)
392 except AttributeError:
393 raise trfExceptions.TransformArgException(trfExit.nameToCode('TRF_ARG_CONV_FAIL'),
394 'Failed to convert %s to a list' % str(value))
395

Member Data Documentation

◆ _name

python.trfArgClasses.argument._name = name
protectedinherited

Definition at line 111 of file trfArgClasses.py.

◆ _runarg

python.trfArgClasses.argument._runarg = runarg
protectedinherited

Definition at line 110 of file trfArgClasses.py.

◆ _splitter

python.trfArgClasses.argList._splitter = splitter
protected

Definition at line 357 of file trfArgClasses.py.

◆ _supressEmptyStrings

python.trfArgClasses.argList._supressEmptyStrings = supressEmptyStrings
protected

Definition at line 358 of file trfArgClasses.py.

◆ _value

python.trfArgClasses.argument._value = value
protectedinherited

Definition at line 130 of file trfArgClasses.py.


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