EnvConfig.Variable.Scalar Class Reference
Inheritance diagram for EnvConfig.Variable.Scalar:
Collaboration diagram for EnvConfig.Variable.Scalar:

Public Member Functions

def __init__
 
def name (self)
 
def set
 
def unset
 
def value
 
def remove_regexp
 
def remove
 
def append
 
def prepend
 
def search (self, expr)
 
def __str__ (self)
 
- Public Member Functions inherited from EnvConfig.Variable.VariableBase
def __init__
 
def process (self, value, env)
 

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 295 of file Variable.py.

Constructor & Destructor Documentation

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

Definition at line 298 of file Variable.py.

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

Member Function Documentation

def EnvConfig.Variable.Scalar.__str__ (   self)

Definition at line 339 of file Variable.py.

339  def __str__(self):
340  return self.val
341 
def EnvConfig.Variable.Scalar.append (   self,
  value,
  separator = ':',
  environment = None 
)
Adds value(s) at the end of the scalar.

Definition at line 327 of file Variable.py.

327  def append(self, value, separator=':', environment=None):# pylint: disable=W0613
328  '''Adds value(s) at the end of the scalar.'''
329  self.val += self.process(value, environment)
330 
def process(self, value, env)
Definition: Variable.py:176
def EnvConfig.Variable.Scalar.name (   self)
Returns the name of the scalar.

Definition at line 302 of file Variable.py.

302  def name(self):
303  '''Returns the name of the scalar.'''
304  return self.varName
305 
def EnvConfig.Variable.Scalar.prepend (   self,
  value,
  separator = ':',
  environment = None 
)
Adds value(s) at the beginning of the scalar.

Definition at line 331 of file Variable.py.

331  def prepend(self, value, separator=':', environment=None):# pylint: disable=W0613
332  '''Adds value(s) at the beginning of the scalar.'''
333  self.val = self.process(value, environment) + self.val
334 
def process(self, value, env)
Definition: Variable.py:176
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 321 of file Variable.py.

321  def remove(self, value, separator=':', regexp=True):# pylint: disable=W0613
322  '''Removes value(s) from the scalar. If value is not found, removal is canceled.'''
323  value = self.search(value)
324  for val in value:
325  self.val = self.val.replace(val, '')
326 
def search(self, expr)
Definition: Variable.py:335
def EnvConfig.Variable.Scalar.remove_regexp (   self,
  value,
  separator = ':' 
)

Definition at line 318 of file Variable.py.

318  def remove_regexp(self, value, separator=':'):
319  self.remove(value, separator, True)
320 
def EnvConfig.Variable.Scalar.search (   self,
  expr 
)
Searches in scalar`s values for a match

Definition at line 335 of file Variable.py.

335  def search(self, expr):
336  '''Searches in scalar`s values for a match'''
337  return re.findall(expr, self.val)
338 
def search(self, expr)
Definition: Variable.py:335
def EnvConfig.Variable.Scalar.set (   self,
  value,
  separator = ':',
  environment = None 
)
Sets the value of the scalar. Any previous value is overwritten.

Definition at line 306 of file Variable.py.

306  def set(self, value, separator=':', environment=None):# pylint: disable=W0613
307  '''Sets the value of the scalar. Any previous value is overwritten.'''
308  self.val = self.process(value, environment)
309 
def process(self, value, env)
Definition: Variable.py:176
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 310 of file Variable.py.

310  def unset(self, value, separator=':', environment=None):# pylint: disable=W0613
311  '''Sets the value of the variable to empty. Any previous value is overwritten.'''
312  self.val = ''
313 
def EnvConfig.Variable.Scalar.value (   self,
  asString = False,
  separator = ':' 
)
Returns values of the scalar.

Definition at line 314 of file Variable.py.

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

Member Data Documentation

EnvConfig.Variable.Scalar.val

Definition at line 300 of file Variable.py.


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