13 from __future__
import absolute_import
24 log = logging.getLogger(__name__)
26 _InstallRootLoggingHandler()
28 allConfigurables = Configurable.allConfigurables
33 log = logging.getLogger(
'PropertyProxy')
34 log.debug(
"Read module info for %d configurables from %d genConfDb files",
36 if len(cfgDb.duplicates()) > 0:
37 log.warning(
"Found %d duplicates among the %d genConfDb files :",
38 len(cfgDb.duplicates()), nFiles)
39 log.warning(
"--------------------------------------------------")
40 log.warning(
" -%s: %s - %s",
"<component name>",
"<module>",
42 log.warning(
"--------------------------------------------------")
43 dups = cfgDb.duplicates()
44 for cfgName
in dups.keys():
45 log.warning(
" -%s: %s - %s", cfgName, cfgDb[cfgName][
'module'],
46 str([d[
'module']
for d
in dups[cfgName]]))
49 log.warning(
"Fix your cmt/requirements file !!")
52 log.debug(
"No duplicates have been found: that's good !")
65 local[conf] = confDbGetConfigurable(conf)
69 """Return a dictionary representing the configuration.
70 The dictionary contains one entry per configurable which is a dictionary
71 with one entry per property.
72 The optional argument "all" is used to decide if to include only values
73 different from the default or all of them.
75 from GaudiKernel.Proxy.Configurable
import getNeededConfigurables
77 catalog = allConfigurables
82 if n
not in conf_dict:
84 for p, v
in catalog[n].getDefaultProperties().
items():
88 if n
not in conf_dict:
90 for p, v
in catalog[n].getValuedProperties().
items():
93 keys = conf_dict.keys()
97 ret_dict[n] = conf_dict[n]
102 """Helper function to get a configurable with the given name regardless
104 If defaultType can be a class derived from configurable or a string. If not
105 specified, the tool name is used as type."""
106 if name
in allConfigurables:
107 return allConfigurables[name]
110 if defaultType
is None:
113 if type(defaultType)
is str:
115 if defaultType
in globals():
117 defaultType = globals()[defaultType]
121 defaultType = getattr(Configurables, defaultType)
122 return defaultType(name)
126 """Configurable to enable ROOT-based persistency.
128 Note: it requires Gaudi::RootCnvSvc (package RootCnv).
133 """Apply low-level configuration"""
134 from Configurables
import (
141 from Configurables
import (
148 EventPersistencySvc().CnvServices += cnvSvcs