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
SequenceVisitors.ModuleNamesFromGlobalsVisitor Class Reference
Inheritance diagram for SequenceVisitors.ModuleNamesFromGlobalsVisitor:

Public Member Functions

def __init__
 
def enter
 
def leave
 

Private Attributes

 _moduleToName
 
 _names
 

Detailed Description

Fill a list with the names of Event module types in a sequence. The names are determined
by using globals() to lookup the variable names assigned to the modules. This
allows the determination of the labels before the modules have been attached to a Process.

Definition at line 137 of file SequenceVisitors.py.

Constructor & Destructor Documentation

def SequenceVisitors.ModuleNamesFromGlobalsVisitor.__init__ (   self,
  globals_,
  l 
)

Definition at line 141 of file SequenceVisitors.py.

142  def __init__(self,globals_,l):
143  self._moduleToName = { v[1]:v[0] for v in globals_.items() if isinstance(v[1],_Module) }
self._names =l

Member Function Documentation

def SequenceVisitors.ModuleNamesFromGlobalsVisitor.enter (   self,
  node 
)

Definition at line 144 of file SequenceVisitors.py.

References SequenceVisitors.ModuleNamesFromGlobalsVisitor._moduleToName.

145  def enter(self,node):
146  if isinstance(node,_Module):
self._names.append(self._moduleToName[node])
def SequenceVisitors.ModuleNamesFromGlobalsVisitor.leave (   self,
  node 
)

Definition at line 147 of file SequenceVisitors.py.

148  def leave(self,node):
149  return

Member Data Documentation

SequenceVisitors.ModuleNamesFromGlobalsVisitor._moduleToName
private

Definition at line 142 of file SequenceVisitors.py.

Referenced by SequenceVisitors.ModuleNamesFromGlobalsVisitor.enter().

SequenceVisitors.ModuleNamesFromGlobalsVisitor._names
private

Definition at line 143 of file SequenceVisitors.py.