CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
HipPyOptionParser Namespace Reference

Classes

class  HipPyOptionParser
 

Functions

def getPSetDict
 
def insertPSetToPSet
 
def insertPSetToVPSet
 
def insertValToPSet
 
def isGoodEntry
 
def matchPSetsByRecord
 
def mergeVPSets
 
def parseBoolString
 

Function Documentation

def HipPyOptionParser.getPSetDict (   thePSet)

Definition at line 9 of file HipPyOptionParser.py.

Referenced by insertPSetToPSet().

9 
10 def getPSetDict(thePSet):
11  return thePSet.parameters_()
def HipPyOptionParser.insertPSetToPSet (   inPSet,
  outPSet 
)

Definition at line 15 of file HipPyOptionParser.py.

References getPSetDict(), and insertValToPSet().

15 
16 def insertPSetToPSet(inPSet, outPSet):
17  for key,val in getPSetDict(inPSet.items()):
18  insertValToPSet(key,val,outPSet)
def HipPyOptionParser.insertPSetToVPSet (   inPSet,
  outVPSet 
)

Definition at line 19 of file HipPyOptionParser.py.

Referenced by mergeVPSets().

19 
20 def insertPSetToVPSet(inPSet, outVPSet):
21  outVPSet.append(inPSet)
22 
def HipPyOptionParser.insertValToPSet (   name,
  val,
  thePSet 
)

Definition at line 12 of file HipPyOptionParser.py.

Referenced by insertPSetToPSet().

12 
13 def insertValToPSet(name,val,thePSet):
14  setattr(thePSet,name,val)
def HipPyOptionParser.isGoodEntry (   var)

Definition at line 50 of file HipPyOptionParser.py.

50 
51 def isGoodEntry(var):
52  if (var is None):
53  return False
54  elif (var == []):
55  return False
56  else:
57  return True
58 
def HipPyOptionParser.matchPSetsByRecord (   ps1,
  ps2 
)

Definition at line 23 of file HipPyOptionParser.py.

23 
24 def matchPSetsByRecord(ps1, ps2):
25  if hasattr(ps1,"record") and hasattr(ps2,"record"):
26  s1=ps1.record.value()
27  s2=ps2.record.value()
28  return (s1==s2)
29  return False
30 
def HipPyOptionParser.mergeVPSets (   inVPSet,
  overrideVPSet,
  matchrule = None 
)

Definition at line 31 of file HipPyOptionParser.py.

References insertPSetToVPSet().

31 
32 def mergeVPSets(inVPSet, overrideVPSet, matchrule=None):
33  resvpset=overrideVPSet.copy()
34  for iop in inVPSet.value():
35  nomatch=True
36  if matchrule is not None:
37  for cps in overrideVPSet.value():
38  if matchrule(cps,iop):
39  nomatch=False
40  break
41  if nomatch:
42  insertPSetToVPSet(iop,resvpset)
43  return resvpset
44 
45 
46 
def HipPyOptionParser.parseBoolString (   theString)

Definition at line 47 of file HipPyOptionParser.py.

47 
48 def parseBoolString(theString):
49  return theString[0].upper()=='T'