CMS 3D CMS Logo

Public Member Functions | Public Attributes

lumiCalc2::RegexValidator Class Reference

List of all members.

Public Member Functions

def __call__
def __init__

Public Attributes

 pattern
 statement

Detailed Description

Definition at line 7 of file lumiCalc2.py.


Constructor & Destructor Documentation

def lumiCalc2::RegexValidator::__init__ (   self,
  pattern,
  statement = None 
)

Definition at line 8 of file lumiCalc2.py.

00009                                                :
00010         self.pattern = re.compile(pattern)
00011         self.statement = statement
00012         if not self.statement:
00013             self.statement = "must match pattern %s" % self.pattern


Member Function Documentation

def lumiCalc2::RegexValidator::__call__ (   self,
  string 
)

Definition at line 14 of file lumiCalc2.py.

00015                               :
00016         match = self.pattern.search(string)
00017         if not match:
00018             raise ValueError(self.statement)
00019         return string 
00020         
00021 beamChoices=['PROTPHYS','IONPHYS','PAPHYS']


Member Data Documentation

Definition at line 8 of file lumiCalc2.py.

Definition at line 8 of file lumiCalc2.py.