CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Mixins._SpecialImportRegistry Class Reference
Inheritance diagram for Mixins._SpecialImportRegistry:

Public Member Functions

def __init__ (self)
 
def getSpecialImports (self)
 
def registerSpecialImportForType (self, cls, impStatement)
 
def registerUse (self, obj)
 

Private Member Functions

def _reset (self)
 

Private Attributes

 _registry
 

Detailed Description

This class collects special import statements of configuration types

Definition at line 25 of file Mixins.py.

Constructor & Destructor Documentation

◆ __init__()

def Mixins._SpecialImportRegistry.__init__ (   self)

Definition at line 27 of file Mixins.py.

27  def __init__(self):
28  self._registry = {}
29 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ _reset()

def Mixins._SpecialImportRegistry._reset (   self)
private

Definition at line 30 of file Mixins.py.

References Mixins._SpecialImportRegistry._registry, and contentValuesCheck.values.

30  def _reset(self):
31  for lst in self._registry.values():
32  lst[1] = False
33 

◆ getSpecialImports()

def Mixins._SpecialImportRegistry.getSpecialImports (   self)

Definition at line 47 of file Mixins.py.

References Mixins._SpecialImportRegistry._registry, and contentValuesCheck.values.

47  def getSpecialImports(self):
48  coll = set()
49  for (imp, used) in self._registry.values():
50  if used:
51  coll.add(imp)
52  return sorted(coll)
53 

◆ registerSpecialImportForType()

def Mixins._SpecialImportRegistry.registerSpecialImportForType (   self,
  cls,
  impStatement 
)

Definition at line 34 of file Mixins.py.

References Types._Untracked.__name__, and Mixins._SpecialImportRegistry._registry.

34  def registerSpecialImportForType(self, cls, impStatement):
35  className = cls.__name__
36  if className in self._registry:
37  raise RuntimeError("Error: the configuration type '%s' already has an import statement registered '%s'" % (className, self._registry[className][0]))
38  self._registry[className] = [impStatement, False]
39 

◆ registerUse()

def Mixins._SpecialImportRegistry.registerUse (   self,
  obj 
)

Definition at line 40 of file Mixins.py.

References Mixins._SpecialImportRegistry._registry.

40  def registerUse(self, obj):
41  className = obj.__class__.__name__
42  try:
43  self._registry[className][1] = True
44  except KeyError:
45  pass
46 

Member Data Documentation

◆ _registry

Mixins._SpecialImportRegistry._registry
private