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 51 of file ConfigurableDb.py.

Constructor & Destructor Documentation

◆ __init__()

def python.ConfigurableDb._CfgDb.__init__ (   self)

Definition at line 66 of file ConfigurableDb.py.

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

Member Function Documentation

◆ _loadModule()

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

Definition at line 112 of file ConfigurableDb.py.

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

◆ 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 79 of file ConfigurableDb.py.

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

◆ duplicates()

def python.ConfigurableDb._CfgDb.duplicates (   self)

Definition at line 108 of file ConfigurableDb.py.

108  def duplicates(self):
109  return self._duplicates
110 
111 

◆ msg()

def python.ConfigurableDb._CfgDb.msg (   self)

Definition at line 72 of file ConfigurableDb.py.

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

Member Data Documentation

◆ __slots__

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

Definition at line 61 of file ConfigurableDb.py.

◆ _duplicates

python.ConfigurableDb._CfgDb._duplicates
private

Definition at line 68 of file ConfigurableDb.py.

◆ _msg

python.ConfigurableDb._CfgDb._msg
private

for messaging

Definition at line 69 of file ConfigurableDb.py.


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