CMS 3D CMS Logo

Public Member Functions | Private Attributes

helpers::MassSearchReplaceParamVisitor Class Reference

List of all members.

Public Member Functions

def __init__
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 35 of file helpers.py.


Constructor & Destructor Documentation

def helpers::MassSearchReplaceParamVisitor::__init__ (   self,
  paramName,
  paramSearch,
  paramValue,
  verbose = False 
)

Definition at line 37 of file helpers.py.

00038                                                                      :
00039         self._paramName   = paramName
00040         self._paramValue  = paramValue
00041         self._paramSearch = paramSearch
        self._verbose = verbose

Member Function Documentation

def helpers::MassSearchReplaceParamVisitor::enter (   self,
  visitee 
)

Definition at line 42 of file helpers.py.

00043                            :
00044         if (hasattr(visitee,self._paramName)):
00045             if getattr(visitee,self._paramName) == self._paramSearch:
00046                 if self._verbose:print "Replaced %s.%s: %s => %s" % (visitee,self._paramName,getattr(visitee,self._paramName),self._paramValue)
                setattr(visitee,self._paramName,self._paramValue)
def helpers::MassSearchReplaceParamVisitor::leave (   self,
  visitee 
)

Definition at line 47 of file helpers.py.

00048                            :
00049         pass


Member Data Documentation

Definition at line 37 of file helpers.py.

Definition at line 37 of file helpers.py.

Definition at line 37 of file helpers.py.

Definition at line 37 of file helpers.py.