proxygen
pump.Env Class Reference

Public Member Functions

def __init__ (self)
 
def Clone (self)
 
def PushVariable (self, var, value)
 
def PopVariable (self)
 
def PushRange (self, var, lower, upper)
 
def PopRange (self)
 
def GetValue (self, identifier)
 
def EvalExp (self, exp)
 
def GetRange (self, identifier)
 
def __init__ (self)
 
def Clone (self)
 
def PushVariable (self, var, value)
 
def PopVariable (self)
 
def PushRange (self, var, lower, upper)
 
def PopRange (self)
 
def GetValue (self, identifier)
 
def EvalExp (self, exp)
 
def GetRange (self, identifier)
 
def __init__ (self)
 
def Clone (self)
 
def PushVariable (self, var, value)
 
def PopVariable (self)
 
def PushRange (self, var, lower, upper)
 
def PopRange (self)
 
def GetValue (self, identifier)
 
def EvalExp (self, exp)
 
def GetRange (self, identifier)
 

Public Attributes

 variables
 
 ranges
 

Detailed Description

Definition at line 584 of file pump.py.

Constructor & Destructor Documentation

def pump.Env.__init__ (   self)

Definition at line 585 of file pump.py.

Referenced by pump.Env.__init__().

585  def __init__(self):
586  self.variables = []
587  self.ranges = []
588 
def __init__(self)
Definition: pump.py:585
variables
Definition: pump.py:586
ranges
Definition: pump.py:587
def pump.Env.__init__ (   self)

Definition at line 585 of file pump.py.

References pump.Env.__init__(), pump.Env.ranges, and pump.Env.variables.

585  def __init__(self):
586  self.variables = []
587  self.ranges = []
588 
def __init__(self)
Definition: pump.py:585
variables
Definition: pump.py:586
ranges
Definition: pump.py:587
def pump.Env.__init__ (   self)

Definition at line 585 of file pump.py.

References pump.Env.__init__(), pump.Env.ranges, and pump.Env.variables.

585  def __init__(self):
586  self.variables = []
587  self.ranges = []
588 
def __init__(self)
Definition: pump.py:585
variables
Definition: pump.py:586
ranges
Definition: pump.py:587

Member Function Documentation

def pump.Env.Clone (   self)

Definition at line 589 of file pump.py.

References pump.Env.ranges, and pump.Env.variables.

Referenced by pump.Env.Clone().

589  def Clone(self):
590  clone = Env()
591  clone.variables = self.variables[:]
592  clone.ranges = self.ranges[:]
593  return clone
594 
def Clone(self)
Definition: pump.py:589
variables
Definition: pump.py:586
ranges
Definition: pump.py:587
def pump.Env.Clone (   self)

Definition at line 589 of file pump.py.

References pump.Env.Clone(), pump.Env.ranges, and pump.Env.variables.

589  def Clone(self):
590  clone = Env()
591  clone.variables = self.variables[:]
592  clone.ranges = self.ranges[:]
593  return clone
594 
def Clone(self)
Definition: pump.py:589
variables
Definition: pump.py:586
ranges
Definition: pump.py:587
def pump.Env.Clone (   self)

Definition at line 589 of file pump.py.

References pump.Env.Clone(), pump.Env.ranges, and pump.Env.variables.

589  def Clone(self):
590  clone = Env()
591  clone.variables = self.variables[:]
592  clone.ranges = self.ranges[:]
593  return clone
594 
def Clone(self)
Definition: pump.py:589
variables
Definition: pump.py:586
ranges
Definition: pump.py:587
def pump.Env.EvalExp (   self,
  exp 
)

Definition at line 622 of file pump.py.

References pump.Env.EvalExp().

622  def EvalExp(self, exp):
623  try:
624  result = eval(exp.python_exp)
625  except Exception, e:
626  print 'ERROR: caught exception %s: %s' % (e.__class__.__name__, e)
627  print ('ERROR: failed to evaluate meta expression %s at %s' %
628  (exp.python_exp, exp.token.start))
629  sys.exit(1)
630  return result
631 
def EvalExp(self, exp)
Definition: pump.py:622
def pump.Env.EvalExp (   self,
  exp 
)

Definition at line 622 of file pump.py.

Referenced by pump.Env.EvalExp().

622  def EvalExp(self, exp):
623  try:
624  result = eval(exp.python_exp)
625  except Exception, e:
626  print 'ERROR: caught exception %s: %s' % (e.__class__.__name__, e)
627  print ('ERROR: failed to evaluate meta expression %s at %s' %
628  (exp.python_exp, exp.token.start))
629  sys.exit(1)
630  return result
631 
def EvalExp(self, exp)
Definition: pump.py:622
def pump.Env.EvalExp (   self,
  exp 
)

Definition at line 622 of file pump.py.

References pump.Env.EvalExp().

622  def EvalExp(self, exp):
623  try:
624  result = eval(exp.python_exp)
625  except Exception, e:
626  print 'ERROR: caught exception %s: %s' % (e.__class__.__name__, e)
627  print ('ERROR: failed to evaluate meta expression %s at %s' %
628  (exp.python_exp, exp.token.start))
629  sys.exit(1)
630  return result
631 
def EvalExp(self, exp)
Definition: pump.py:622
def pump.Env.GetRange (   self,
  identifier 
)

Definition at line 632 of file pump.py.

References pump.Env.ranges.

Referenced by pump.Env.GetRange().

632  def GetRange(self, identifier):
633  for (var, lower, upper) in self.ranges:
634  if identifier == var:
635  return (lower, upper)
636 
637  print 'ERROR: range %s is undefined.' % (identifier,)
638  sys.exit(1)
639 
640 
def GetRange(self, identifier)
Definition: pump.py:632
ranges
Definition: pump.py:587
def pump.Env.GetRange (   self,
  identifier 
)

Definition at line 632 of file pump.py.

References pump.Env.GetRange(), and pump.Env.ranges.

632  def GetRange(self, identifier):
633  for (var, lower, upper) in self.ranges:
634  if identifier == var:
635  return (lower, upper)
636 
637  print 'ERROR: range %s is undefined.' % (identifier,)
638  sys.exit(1)
639 
640 
def GetRange(self, identifier)
Definition: pump.py:632
ranges
Definition: pump.py:587
def pump.Env.GetRange (   self,
  identifier 
)

Definition at line 632 of file pump.py.

References pump.Env.GetRange(), and pump.Env.ranges.

632  def GetRange(self, identifier):
633  for (var, lower, upper) in self.ranges:
634  if identifier == var:
635  return (lower, upper)
636 
637  print 'ERROR: range %s is undefined.' % (identifier,)
638  sys.exit(1)
639 
640 
def GetRange(self, identifier)
Definition: pump.py:632
ranges
Definition: pump.py:587
def pump.Env.GetValue (   self,
  identifier 
)

Definition at line 614 of file pump.py.

References pump.Env.GetValue(), and pump.Env.variables.

614  def GetValue(self, identifier):
615  for (var, value) in self.variables:
616  if identifier == var:
617  return value
618 
619  print 'ERROR: meta variable %s is undefined.' % (identifier,)
620  sys.exit(1)
621 
def GetValue(self, identifier)
Definition: pump.py:614
variables
Definition: pump.py:586
def pump.Env.GetValue (   self,
  identifier 
)

Definition at line 614 of file pump.py.

References pump.Env.GetValue(), and pump.Env.variables.

614  def GetValue(self, identifier):
615  for (var, value) in self.variables:
616  if identifier == var:
617  return value
618 
619  print 'ERROR: meta variable %s is undefined.' % (identifier,)
620  sys.exit(1)
621 
def GetValue(self, identifier)
Definition: pump.py:614
variables
Definition: pump.py:586
def pump.Env.GetValue (   self,
  identifier 
)

Definition at line 614 of file pump.py.

References pump.Env.variables.

Referenced by pump.Env.GetValue().

614  def GetValue(self, identifier):
615  for (var, value) in self.variables:
616  if identifier == var:
617  return value
618 
619  print 'ERROR: meta variable %s is undefined.' % (identifier,)
620  sys.exit(1)
621 
def GetValue(self, identifier)
Definition: pump.py:614
variables
Definition: pump.py:586
def pump.Env.PopRange (   self)

Definition at line 611 of file pump.py.

References pump.Env.ranges.

Referenced by pump.Env.PopRange().

611  def PopRange(self):
612  self.ranges[:1] = []
613 
def PopRange(self)
Definition: pump.py:611
ranges
Definition: pump.py:587
def pump.Env.PopRange (   self)

Definition at line 611 of file pump.py.

References pump.Env.PopRange(), and pump.Env.ranges.

611  def PopRange(self):
612  self.ranges[:1] = []
613 
def PopRange(self)
Definition: pump.py:611
ranges
Definition: pump.py:587
def pump.Env.PopRange (   self)

Definition at line 611 of file pump.py.

References pump.Env.PopRange(), and pump.Env.ranges.

611  def PopRange(self):
612  self.ranges[:1] = []
613 
def PopRange(self)
Definition: pump.py:611
ranges
Definition: pump.py:587
def pump.Env.PopVariable (   self)

Definition at line 605 of file pump.py.

References pump.Env.PopVariable(), and pump.Env.variables.

605  def PopVariable(self):
606  self.variables[:1] = []
607 
def PopVariable(self)
Definition: pump.py:605
variables
Definition: pump.py:586
def pump.Env.PopVariable (   self)

Definition at line 605 of file pump.py.

References pump.Env.PopVariable(), and pump.Env.variables.

605  def PopVariable(self):
606  self.variables[:1] = []
607 
def PopVariable(self)
Definition: pump.py:605
variables
Definition: pump.py:586
def pump.Env.PopVariable (   self)

Definition at line 605 of file pump.py.

References pump.Env.variables.

Referenced by pump.Env.PopVariable().

605  def PopVariable(self):
606  self.variables[:1] = []
607 
def PopVariable(self)
Definition: pump.py:605
variables
Definition: pump.py:586
def pump.Env.PushRange (   self,
  var,
  lower,
  upper 
)

Definition at line 608 of file pump.py.

References pump.Env.ranges.

Referenced by pump.Env.PushRange().

608  def PushRange(self, var, lower, upper):
609  self.ranges[:0] = [(var, lower, upper)]
610 
def PushRange(self, var, lower, upper)
Definition: pump.py:608
ranges
Definition: pump.py:587
def pump.Env.PushRange (   self,
  var,
  lower,
  upper 
)

Definition at line 608 of file pump.py.

References pump.Env.PushRange(), and pump.Env.ranges.

608  def PushRange(self, var, lower, upper):
609  self.ranges[:0] = [(var, lower, upper)]
610 
def PushRange(self, var, lower, upper)
Definition: pump.py:608
ranges
Definition: pump.py:587
def pump.Env.PushRange (   self,
  var,
  lower,
  upper 
)

Definition at line 608 of file pump.py.

References pump.Env.PushRange(), and pump.Env.ranges.

608  def PushRange(self, var, lower, upper):
609  self.ranges[:0] = [(var, lower, upper)]
610 
def PushRange(self, var, lower, upper)
Definition: pump.py:608
ranges
Definition: pump.py:587
def pump.Env.PushVariable (   self,
  var,
  value 
)

Definition at line 595 of file pump.py.

References pump.Env.variables.

Referenced by pump.Env.PushVariable().

595  def PushVariable(self, var, value):
596  # If value looks like an int, store it as an int.
597  try:
598  int_value = int(value)
599  if ('%s' % int_value) == value:
600  value = int_value
601  except Exception:
602  pass
603  self.variables[:0] = [(var, value)]
604 
def PushVariable(self, var, value)
Definition: pump.py:595
variables
Definition: pump.py:586
def pump.Env.PushVariable (   self,
  var,
  value 
)

Definition at line 595 of file pump.py.

References pump.Env.PushVariable(), and pump.Env.variables.

595  def PushVariable(self, var, value):
596  # If value looks like an int, store it as an int.
597  try:
598  int_value = int(value)
599  if ('%s' % int_value) == value:
600  value = int_value
601  except Exception:
602  pass
603  self.variables[:0] = [(var, value)]
604 
def PushVariable(self, var, value)
Definition: pump.py:595
variables
Definition: pump.py:586
def pump.Env.PushVariable (   self,
  var,
  value 
)

Definition at line 595 of file pump.py.

References pump.Env.PushVariable(), and pump.Env.variables.

595  def PushVariable(self, var, value):
596  # If value looks like an int, store it as an int.
597  try:
598  int_value = int(value)
599  if ('%s' % int_value) == value:
600  value = int_value
601  except Exception:
602  pass
603  self.variables[:0] = [(var, value)]
604 
def PushVariable(self, var, value)
Definition: pump.py:595
variables
Definition: pump.py:586

Member Data Documentation

pump.Env.ranges
pump.Env.variables

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