ATLAS Offline Software
Loading...
Searching...
No Matches
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

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

Protected Member Functions

 _loadModule (self, fname)

Protected Attributes

dict _duplicates = {}
 _msg = None
 for messaging

Static Private Attributes

dict __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__()

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()

python.ConfigurableDb._CfgDb._loadModule ( self,
fname )
protected

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
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ add()

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
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55
bool verbose
Definition hcg.cxx:73

◆ duplicates()

python.ConfigurableDb._CfgDb.duplicates ( self)

Definition at line 108 of file ConfigurableDb.py.

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

◆ msg()

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
MsgStream & msg
Definition testRead.cxx:32

Member Data Documentation

◆ __slots__

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

Definition at line 61 of file ConfigurableDb.py.

◆ _duplicates

dict python.ConfigurableDb._CfgDb._duplicates = {}
protected

Definition at line 68 of file ConfigurableDb.py.

◆ _msg

python.ConfigurableDb._CfgDb._msg = None
protected

for messaging

Definition at line 69 of file ConfigurableDb.py.


The documentation for this class was generated from the following file: