CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
MassReplace.MassSearchReplaceParamVisitor Class Reference
Inheritance diagram for MassReplace.MassSearchReplaceParamVisitor:

Public Member Functions

def __init__
 
def doIt
 
def enter
 
def leave
 

Private Attributes

 _paramName
 
 _paramSearch
 
 _paramValue
 
 _verbose
 

Detailed Description

Visitor that travels within a cms.Sequence, looks for a parameter and replaces its value

Definition at line 108 of file MassReplace.py.

Constructor & Destructor Documentation

def MassReplace.MassSearchReplaceParamVisitor.__init__ (   self,
  paramName,
  paramSearch,
  paramValue,
  verbose = False 
)

Definition at line 110 of file MassReplace.py.

111  def __init__(self,paramName,paramSearch,paramValue,verbose=False):
112  self._paramName = paramName
113  self._paramValue = paramValue
114  self._paramSearch = paramSearch
self._verbose = verbose

Member Function Documentation

def MassReplace.MassSearchReplaceParamVisitor.doIt (   self,
  mod,
  name 
)

Definition at line 121 of file MassReplace.py.

References MassReplace.MassSearchParamVisitor._paramName, MassReplace.MassSearchReplaceParamVisitor._paramName, MassReplace.MassSearchReplaceAnyInputTagVisitor._paramSearch, MassReplace.MassSearchParamVisitor._paramSearch, MassReplace.MassSearchReplaceParamVisitor._paramSearch, ConfigBuilder.ConfigBuilder.MassSearchReplaceProcessNameVisitor._paramSearch, MassReplace.MassSearchReplaceParamVisitor._paramValue, MassReplace.MassSearchReplaceAnyInputTagVisitor._verbose, uploads.output._verbose, uploads.uploader._verbose, MassReplace.MassSearchReplaceParamVisitor._verbose, ConfigBuilder.ConfigBuilder.MassSearchReplaceProcessNameVisitor._verbose, and print().

Referenced by MassReplace.MassSearchReplaceParamVisitor.enter().

122  def doIt(self, mod, name):
123  if (hasattr(mod,self._paramName)):
124  if getattr(mod,self._paramName) == self._paramSearch:
125  if self._verbose:print("Replaced %s.%s: %s => %s" % (name,self._paramName,getattr(mod,self._paramName),self._paramValue))
setattr(mod,self._paramName,self._paramValue)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def MassReplace.MassSearchReplaceParamVisitor.enter (   self,
  visitee 
)

Definition at line 115 of file MassReplace.py.

References TkCommonModeCalculator.doIt(), MassReplace.MassSearchReplaceAnyInputTagVisitor.doIt(), MedianCommonModeCalculator.doIt(), TT6CommonModeCalculator.doIt(), MassReplace.MassSearchReplaceParamVisitor.doIt(), ConfigBuilder.ConfigBuilder.MassSearchReplaceProcessNameVisitor.doIt(), and str.

116  def enter(self,visitee):
117  if isinstance(visitee, cms.SwitchProducer):
118  for modName in visitee.parameterNames_():
119  self.doIt(getattr(visitee, modName), "%s.%s"%(str(visitee), modName))
120  else:
self.doIt(visitee, str(visitee))
#define str(s)
def MassReplace.MassSearchReplaceParamVisitor.leave (   self,
  visitee 
)

Definition at line 126 of file MassReplace.py.

127  def leave(self,visitee):
128  pass

Member Data Documentation

MassReplace.MassSearchReplaceParamVisitor._paramName
private

Definition at line 111 of file MassReplace.py.

Referenced by MassReplace.MassSearchReplaceParamVisitor.doIt().

MassReplace.MassSearchReplaceParamVisitor._paramSearch
private

Definition at line 113 of file MassReplace.py.

Referenced by MassReplace.MassSearchReplaceParamVisitor.doIt().

MassReplace.MassSearchReplaceParamVisitor._paramValue
private

Definition at line 112 of file MassReplace.py.

Referenced by MassReplace.MassSearchReplaceParamVisitor.doIt().

MassReplace.MassSearchReplaceParamVisitor._verbose
private

Definition at line 114 of file MassReplace.py.

Referenced by helpers.CloneSequenceVisitor.clonedSequence(), helpers.CloneTaskVisitor.clonedTask(), and MassReplace.MassSearchReplaceParamVisitor.doIt().