13 from __future__
import absolute_import
26 InstallRootLoggingHandler
as _InstallRootLoggingHandler,
30 log = logging.getLogger(__name__)
32 _InstallRootLoggingHandler()
34 allConfigurables = Configurable.allConfigurables
39 log = logging.getLogger(
"PropertyProxy")
41 "Read module info for %d configurables from %d genConfDb files",
45 if len(cfgDb.duplicates()) > 0:
47 "Found %d duplicates among the %d genConfDb files :",
48 len(cfgDb.duplicates()),
51 log.warning(
"--------------------------------------------------")
53 " -%s: %s - %s",
"<component name>",
"<module>",
"[ <duplicates> ]"
55 log.warning(
"--------------------------------------------------")
56 dups = cfgDb.duplicates()
57 for cfgName
in dups.keys():
61 cfgDb[cfgName][
"module"],
62 str([d[
"module"]
for d
in dups[cfgName]]),
68 log.debug(
"No duplicates have been found: that's good !")
78 local[conf] = confDbGetConfigurable(conf)
82 """Return a dictionary representing the configuration.
83 The dictionary contains one entry per configurable which is a dictionary
84 with one entry per property.
85 The optional argument "all" is used to decide if to include only values
86 different from the default or all of them.
88 from GaudiKernel.Proxy.Configurable
import getNeededConfigurables
90 catalog = allConfigurables
95 if n
not in conf_dict:
97 for p, v
in catalog[n].getDefaultProperties().
items():
101 if n
not in conf_dict:
103 for p, v
in catalog[n].getValuedProperties().
items():
106 keys = conf_dict.keys()
110 ret_dict[n] = conf_dict[n]
115 """Helper function to get a configurable with the given name regardless
117 If defaultType can be a class derived from configurable or a string. If not
118 specified, the tool name is used as type."""
119 if name
in allConfigurables:
120 return allConfigurables[name]
123 if defaultType
is None:
126 if type(defaultType)
is str:
128 if defaultType
in globals():
130 defaultType = globals()[defaultType]
135 defaultType = getattr(Configurables, defaultType)
136 return defaultType(name)