| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
GaudiKernel.ConfigurableDb._CfgDb Class Reference
Inheritance diagram for GaudiKernel.ConfigurableDb._CfgDb:
[legend]
Collaboration diagram for GaudiKernel.ConfigurableDb._CfgDb:
[legend]

## Public Member Functions
def | __init__ (self)
def | add (self, configurable, package, module, lib)
def | duplicates (self)

## Private Member Functions
def | _loadModule (self, fname)

## Private Attributes
| _duplicates

## Static Private Attributes
dictionary | __slots__

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ __init__()

def GaudiKernel.ConfigurableDb._CfgDb.__init__ | ( |  | self | ) |

Definition at line 36 of file ConfigurableDb.py.

36 def __init__(self):
37 object.__init__(self)
38 self._duplicates = {}
39

## Member Function Documentation

## ◆ _loadModule()

def GaudiKernel.ConfigurableDb._CfgDb._loadModule | ( |  | self,
|  |  | fname
| ) |  |
| private

Definition at line 67 of file ConfigurableDb.py.

67 def _loadModule(self, fname):
68 f = open(fname)
69 for i, ll in enumerate(f):
70 l = ll.strip()
71 if l.startswith('#') or len(l) <= 0:
72 continue
73 try:
74 line = l.split()
75 cname = line[2]
76 pkg = line[0].split('.')[0]
77 module = line[0]
78 lib = line[1]
79 self.add(cname, pkg, module, lib)
80 except Exception:
81 f.close()
82 raise Exception(
83 "invalid line format: %s:%d: %r" % (fname, i + 1, ll))
84 f.close()
85
86

## ◆ add()

def GaudiKernel.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 40 of file ConfigurableDb.py.

40 def add(self, configurable, package, module, lib):
41 """Method to populate the Db.
42 It is called from the auto-generated Xyz_confDb.py files (genconf.cpp)
43 @param configurable: the name of the configurable being added
44 @param package: the name of the package which holds this Configurable
45 @param module: the name of the python module holding the Configurable
46 @param lib: the name of the library holding the component(s) (ie: the
47 C++ Gaudi component which is mapped by the Configurable)
48 """
49 cfg = {'package': package, 'module': module, 'lib': lib}
50 if self.has_key(configurable):
51 # check if it comes from the same library...
52 if cfg['lib'] != self[configurable]['lib']:
53 log.debug("dup!! [%s] p=%s m=%s lib=%s", configurable, package,
54 module, lib)
55 if self._duplicates.has_key(configurable):
56 self._duplicates[configurable] += [cfg]
57 else:
58 self._duplicates[configurable] = [cfg]
59 else:
60 log.debug("added [%s] p=%s m=%s lib=%s", configurable, package,
61 module, lib)
62 self[configurable] = cfg
63
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:39

## ◆ duplicates()

def GaudiKernel.ConfigurableDb._CfgDb.duplicates | ( |  | self | ) |

Definition at line 64 of file ConfigurableDb.py.

64 def duplicates(self):
65 return self._duplicates
66

## Member Data Documentation

## ◆ __slots__

dictionary GaudiKernel.ConfigurableDb._CfgDb.__slots__
| static private

Initial value:
= {
'_duplicates': {},
}

Definition at line 32 of file ConfigurableDb.py.

## ◆ _duplicates

GaudiKernel.ConfigurableDb._CfgDb._duplicates
| private

Definition at line 38 of file ConfigurableDb.py.

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

- GaudiKernel/python/GaudiKernel/ConfigurableDb.py