GaudiKernel.ConfigurableDb._CfgDb Class Reference
Inheritance diagram for GaudiKernel.ConfigurableDb._CfgDb:
Collaboration diagram for GaudiKernel.ConfigurableDb._CfgDb:

Public Member Functions

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

Private Member Functions

def _loadModule (self, fname)
 
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 18 of file ConfigurableDb.py.

Constructor & Destructor Documentation

def GaudiKernel.ConfigurableDb._CfgDb.__init__ (   self)

Definition at line 32 of file ConfigurableDb.py.

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

Definition at line 32 of file ConfigurableDb.py.

32  def __init__(self):
33  object.__init__(self)
34  self._duplicates = {}
35 

Member Function Documentation

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

Definition at line 65 of file ConfigurableDb.py.

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

Definition at line 65 of file ConfigurableDb.py.

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

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

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

Definition at line 62 of file ConfigurableDb.py.

def GaudiKernel.ConfigurableDb._CfgDb.duplicates (   self)

Definition at line 62 of file ConfigurableDb.py.

Member Data Documentation

dictionary GaudiKernel.ConfigurableDb._CfgDb.__slots__
staticprivate
Initial value:
1 = {
2  '_duplicates' : { },
3  }

Definition at line 28 of file ConfigurableDb.py.

GaudiKernel.ConfigurableDb._CfgDb._duplicates
private

Definition at line 34 of file ConfigurableDb.py.


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