CMS 3D CMS Logo

Public Member Functions | Static Public Attributes

hltFindDuplicates::ModuleList Class Reference

List of all members.

Public Member Functions

def __init__
def append
def apply_rename
def dump
def extend
def group
def sort

Static Public Attributes

list modules = []

Detailed Description

Definition at line 103 of file hltFindDuplicates.py.


Constructor & Destructor Documentation

def hltFindDuplicates::ModuleList::__init__ (   self,
  args 
)

Definition at line 115 of file hltFindDuplicates.py.

00116                            :
00117     for arg in args:
00118       if '__iter__' in dir(arg):
00119         self.extend(arg)
00120       else:
00121         self.append(arg)


Member Function Documentation

def hltFindDuplicates::ModuleList::append (   self,
  module 
)

Definition at line 106 of file hltFindDuplicates.py.

00107                           :
00108     m = Module(module)
00109     if not whitelist(m):
00110       self.modules.append(m)

def hltFindDuplicates::ModuleList::apply_rename (   self,
  groups 
)

Definition at line 140 of file hltFindDuplicates.py.

00141                                 :
00142     for module in self.modules:
00143       module.apply_rename(groups)

def hltFindDuplicates::ModuleList::dump (   self)

Definition at line 144 of file hltFindDuplicates.py.

00145                 :
00146     for m in self.modules:
00147       print "%s = (%s) {" % (m.label, m.type)
00148       for k, v in m.params.iteritems():
00149         print "\t%s = %s" % (k, v)
00150       print '}'
00151       print
00152 
00153 

def hltFindDuplicates::ModuleList::extend (   self,
  modules 
)

Definition at line 111 of file hltFindDuplicates.py.

00112                            :
00113     for module in modules:
00114       self.append(module)

def hltFindDuplicates::ModuleList::group (   self)

Definition at line 125 of file hltFindDuplicates.py.

00126                  :
00127     groups = dict()
00128     self.sort()
00129     i = 0
00130     for v, g in itertools.groupby(self.modules, Module.key):
00131       group = list(g)
00132       if len(group) > 1:
00133         i = i + 1
00134         g = [ m.label for m in group ]
00135         g.sort()
00136         l = 'hltGroup%d' %i
00137         r = re.compile(r'^(%s)($|:)' % r'|'.join(g))
00138         groups[l] = (g, r)
00139     return groups

def hltFindDuplicates::ModuleList::sort (   self)

Definition at line 122 of file hltFindDuplicates.py.

00123                 :
00124     self.modules.sort(key = Module.key)


Member Data Documentation

Definition at line 104 of file hltFindDuplicates.py.