ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
python.ConfigurableDb._CfgDb Class Reference

singleton holding configurable and loadable information ---------------— More...

Inheritance diagram for python.ConfigurableDb._CfgDb:
Collaboration diagram for python.ConfigurableDb._CfgDb:

Public Member Functions

def __init__ (self)
 
def msg (self)
 
def add (self, configurable, package, module, lib)
 
def duplicates (self)
 

Private Member Functions

def _loadModule (self, fname)
 

Private Attributes

 _duplicates
 
 _msg
 for messaging More...
 

Static Private Attributes

dictionary __slots__
 

Detailed Description

singleton holding configurable and loadable information ---------------—

A singleton class holding informations about automatically generated
Configurables.
 --> package holding that Configurable
 --> library holding the components related to that Configurable
 --> python module holding the Configurable
 --> a dictionary of duplicates

Definition at line 53 of file ConfigurableDb.py.

Constructor & Destructor Documentation

◆ __init__()

def python.ConfigurableDb._CfgDb.__init__ (   self)

Definition at line 68 of file ConfigurableDb.py.

68  def __init__(self):
69  object.__init__( self )
70  self._duplicates = {}
71  self._msg = None
72 

Member Function Documentation

◆ _loadModule()

def python.ConfigurableDb._CfgDb._loadModule (   self,
  fname 
)
private

Definition at line 114 of file ConfigurableDb.py.

114  def _loadModule(self, fname):
115  f = open(fname)
116  for i,ll in enumerate(f):
117  l = ll.strip()
118  if l.startswith('#') or len(l) <= 0:
119  continue
120  try:
121  line = l.split()
122  cname = line[2]
123  pkg = line[0].split('.')[0]
124  module = line[0]
125  lib = line[1]
126  self.add(cname, pkg, module, lib)
127  except Exception:
128  f.close()
129  raise Exception(
130  "invalid line format: %s:%d: %r" %
131  (fname, i+1, ll)
132  )
133  f.close()
134 

◆ add()

def python.ConfigurableDb._CfgDb.add (   self,
  configurable,
  package,
  module,
  lib 
)
Method to populate the Db.
It is called from the auto-generated Xyz_confDb.py files (genconf.cpp)
@param configurable: the name of the configurable being added
@param package: the name of the package which holds this Configurable
@param module: the name of the python module holding the Configurable
@param lib: the name of the library holding the component(s) (ie: the
      C++ Gaudi component which is mapped by the Configurable)

Definition at line 81 of file ConfigurableDb.py.

81  def add( self, configurable, package, module, lib ):
82  """Method to populate the Db.
83  It is called from the auto-generated Xyz_confDb.py files (genconf.cpp)
84  @param configurable: the name of the configurable being added
85  @param package: the name of the package which holds this Configurable
86  @param module: the name of the python module holding the Configurable
87  @param lib: the name of the library holding the component(s) (ie: the
88  C++ Gaudi component which is mapped by the Configurable)
89  """
90 
91  cfg = { 'package' : package,
92  'module' : module,
93  'lib' : lib }
94 
95  if configurable in self:
96  # check if it comes from the same library...
97  if cfg['lib'] != self[configurable]['lib']:
98  self.msg.verbose( "dup!! [%s] p=%s m=%s lib=%s",
99  configurable, package, module, lib )
100  if configurable in self._duplicates:
101  self._duplicates[configurable] += [ cfg ]
102  else:
103  self._duplicates[configurable] = [ cfg ]
104 
105  else:
106  self.msg.verbose( "added [%s] p=%s m=%s lib=%s",
107  configurable, package, module, lib )
108  self[configurable] = cfg
109 

◆ duplicates()

def python.ConfigurableDb._CfgDb.duplicates (   self)

Definition at line 110 of file ConfigurableDb.py.

110  def duplicates(self):
111  return self._duplicates
112 
113 

◆ msg()

def python.ConfigurableDb._CfgDb.msg (   self)

Definition at line 74 of file ConfigurableDb.py.

74  def msg(self):
75  if self._msg is None:
76 
77  from . import Logging
78  self._msg = Logging.logging.getLogger( 'ConfigurableDb' )
79  return self._msg
80 

Member Data Documentation

◆ __slots__

dictionary python.ConfigurableDb._CfgDb.__slots__
staticprivate
Initial value:
= {
'_duplicates' : { },
'_msg' : None,
}

Definition at line 63 of file ConfigurableDb.py.

◆ _duplicates

python.ConfigurableDb._CfgDb._duplicates
private

Definition at line 70 of file ConfigurableDb.py.

◆ _msg

python.ConfigurableDb._CfgDb._msg
private

for messaging

Definition at line 71 of file ConfigurableDb.py.


The documentation for this class was generated from the following file:
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
generateReferenceFile.duplicates
duplicates
Definition: generateReferenceFile.py:24