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]]),
66 log.warning(
"Fix your cmt/requirements file !!")
69 log.debug(
"No duplicates have been found: that's good !")
79 local[conf] = confDbGetConfigurable(conf)
83 """Return a dictionary representing the configuration.
84 The dictionary contains one entry per configurable which is a dictionary
85 with one entry per property.
86 The optional argument "all" is used to decide if to include only values
87 different from the default or all of them.
89 from GaudiKernel.Proxy.Configurable
import getNeededConfigurables
91 catalog = allConfigurables
96 if n
not in conf_dict:
98 for p, v
in catalog[n].getDefaultProperties().
items():
102 if n
not in conf_dict:
104 for p, v
in catalog[n].getValuedProperties().
items():
107 keys = conf_dict.keys()
111 ret_dict[n] = conf_dict[n]
116 """Helper function to get a configurable with the given name regardless
118 If defaultType can be a class derived from configurable or a string. If not
119 specified, the tool name is used as type."""
120 if name
in allConfigurables:
121 return allConfigurables[name]
124 if defaultType
is None:
127 if type(defaultType)
is str:
129 if defaultType
in globals():
131 defaultType = globals()[defaultType]
136 defaultType = getattr(Configurables, defaultType)
137 return defaultType(name)