| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
EnvConfig.Variable.Scalar Class Reference
Inheritance diagram for EnvConfig.Variable.Scalar:
[legend]
Collaboration diagram for EnvConfig.Variable.Scalar:
[legend]

## Public Member Functions
def | __init__
def | name
def | set
def | unset
def | value
def | remove_regexp
def | remove
def | append
def | prepend
def | search
def | __str__
Public Member Functions inherited from EnvConfig.Variable.VariableBase
def | __init__
def | process

## Public Attributes
| val
Public Attributes inherited from EnvConfig.Variable.VariableBase
| varName
| local
| expandVars
| log

## Detailed Description

    Class for manipulating with environment scalars.

Definition at line 293 of file Variable.py.

## Constructor & Destructor Documentation

def EnvConfig.Variable.Scalar.__init__ | ( |  | self,
|  |  | name,
|  |  | local = `False`
| ) |  |

Definition at line 296 of file Variable.py.

296
297 def __init__(self, name, local=False):
298 super(Scalar, self).__init__(name, local)
299 self.val = ''

## Member Function Documentation

def EnvConfig.Variable.Scalar.__str__ | ( |  | self | ) |

Definition at line 337 of file Variable.py.

337
338 def __str__(self):
339 return self.val

def EnvConfig.Variable.Scalar.append | ( |  | self,
|  |  | value,
|  |  | separator = `':'`,
|  |  | environment = `None`
| ) |  |

    Adds value(s) at the end of the scalar.

Definition at line 325 of file Variable.py.

325
326 def append(self, value, separator=':', environment=None):# pylint: disable=W0613
327 '''Adds value(s) at the end of the scalar.'''
328 self.val += self.process(value, environment)

def EnvConfig.Variable.Scalar.name | ( |  | self | ) |

    Returns the name of the scalar.

Definition at line 300 of file Variable.py.

300
301 def name(self):
302 '''Returns the name of the scalar.'''
303 return self.varName

def EnvConfig.Variable.Scalar.prepend | ( |  | self,
|  |  | value,
|  |  | separator = `':'`,
|  |  | environment = `None`
| ) |  |

    Adds value(s) at the beginning of the scalar.

Definition at line 329 of file Variable.py.

329
330 def prepend(self, value, separator=':', environment=None):# pylint: disable=W0613
331 '''Adds value(s) at the beginning of the scalar.'''
332 self.val = self.process(value, environment) + self.val

def EnvConfig.Variable.Scalar.remove | ( |  | self,
|  |  | value,
|  |  | separator = `':'`,
|  |  | regexp = `True`
| ) |  |

    Removes value(s) from the scalar. If value is not found, removal is canceled.

Definition at line 319 of file Variable.py.

319
320 def remove(self, value, separator=':', regexp=True):# pylint: disable=W0613
321 '''Removes value(s) from the scalar. If value is not found, removal is canceled.'''
322 value = self.search(value)
323 for val in value:
324 self.val = self.val.replace(val, '')

def EnvConfig.Variable.Scalar.remove_regexp | ( |  | self,
|  |  | value,
|  |  | separator = `':'`
| ) |  |

Definition at line 316 of file Variable.py.

316
317 def remove_regexp(self, value, separator=':'):
318 self.remove(value, separator, True)

def EnvConfig.Variable.Scalar.search | ( |  | self,
|  |  | expr
| ) |  |

    Searches in scalar`s values for a match

Definition at line 333 of file Variable.py.

333
334 def search(self, expr):
335 '''Searches in scalar`s values for a match'''
336 return re.findall(expr, self.val)

def EnvConfig.Variable.Scalar.set | ( |  | self,
|  |  | value,
|  |  | separator = `':'`,
|  |  | environment = `None`
| ) |  |

    Sets the value of the scalar. Any previous value is overwritten.

Definition at line 304 of file Variable.py.

304
305 def set(self, value, separator=':', environment=None):# pylint: disable=W0613
306 '''Sets the value of the scalar. Any previous value is overwritten.'''
307 self.val = self.process(value, environment)

def EnvConfig.Variable.Scalar.unset | ( |  | self,
|  |  | value,
|  |  | separator = `':'`,
|  |  | environment = `None`
| ) |  |

    Sets the value of the variable to empty. Any previous value is overwritten.

Definition at line 308 of file Variable.py.

308
309 def unset(self, value, separator=':', environment=None):# pylint: disable=W0613
310 '''Sets the value of the variable to empty. Any previous value is overwritten.'''
311 self.val = ''

def EnvConfig.Variable.Scalar.value | ( |  | self,
|  |  | asString = `False`,
|  |  | separator = `':'`
| ) |  |

    Returns values of the scalar.

Definition at line 312 of file Variable.py.

312
313 def value(self, asString=False, separator=':'):# pylint: disable=W0613
314 '''Returns values of the scalar.'''
315 return self.val

## Member Data Documentation

EnvConfig.Variable.Scalar.val

Definition at line 298 of file Variable.py.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/cmake/EnvConfig/Variable.py