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 24 of file Mixins.py.

Constructor & Destructor Documentation

◆ __init__()

def Mixins._SpecialImportRegistry.__init__ (   self)

Definition at line 26 of file Mixins.py.

26  def __init__(self):
27  self._registry = {}
28 
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 29 of file Mixins.py.

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

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

◆ getSpecialImports()

def Mixins._SpecialImportRegistry.getSpecialImports (   self)

Definition at line 46 of file Mixins.py.

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

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

◆ registerSpecialImportForType()

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

Definition at line 33 of file Mixins.py.

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

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

◆ registerUse()

def Mixins._SpecialImportRegistry.registerUse (   self,
  obj 
)

Definition at line 39 of file Mixins.py.

References Mixins._SpecialImportRegistry._registry.

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

Member Data Documentation

◆ _registry

Mixins._SpecialImportRegistry._registry
private