| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

## Constructor & Destructor Documentation

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

Definition at line 33 of file ConfigurableDb.py.

33 def __init__(self):
34 object.__init__(self)
35 self._duplicates = {}
36
GaudiKernel.ConfigurableDb._CfgDb.__init__
def __init__(self)
Definition: ConfigurableDb.py:33
GaudiKernel.ConfigurableDb._CfgDb._duplicates
_duplicates
Definition: ConfigurableDb.py:35

## Member Function Documentation

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

Definition at line 66 of file ConfigurableDb.py.

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

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

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

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

Definition at line 63 of file ConfigurableDb.py.

63 def duplicates(self):
64 return self._duplicates
65
GaudiKernel.ConfigurableDb._CfgDb.duplicates
def duplicates(self)
Definition: ConfigurableDb.py:63
GaudiKernel.ConfigurableDb._CfgDb._duplicates
_duplicates
Definition: ConfigurableDb.py:35

## Member Data Documentation

dictionary GaudiKernel.ConfigurableDb._CfgDb.__slots__
| static private

Initial value:
1 = {
2 '_duplicates': {},
3 }

Definition at line 29 of file ConfigurableDb.py.

GaudiKernel.ConfigurableDb._CfgDb._duplicates
| private

Definition at line 35 of file ConfigurableDb.py.

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

- GaudiKernel/python/GaudiKernel/ConfigurableDb.py