13 from __future__
import absolute_import
24 InstallRootLoggingHandler
as _InstallRootLoggingHandler,
28 log = logging.getLogger(__name__)
30 _InstallRootLoggingHandler()
32 allConfigurables = Configurable.allConfigurables
37 log = logging.getLogger(
"PropertyProxy")
39 "Read module info for %d configurables from %d genConfDb files",
43 if len(cfgDb.duplicates()) > 0:
45 "Found %d duplicates among the %d genConfDb files :",
46 len(cfgDb.duplicates()),
49 log.warning(
"--------------------------------------------------")
51 " -%s: %s - %s",
"<component name>",
"<module>",
"[ <duplicates> ]"
53 log.warning(
"--------------------------------------------------")
54 dups = cfgDb.duplicates()
55 for cfgName
in dups.keys():
59 cfgDb[cfgName][
"module"],
60 str([d[
"module"]
for d
in dups[cfgName]]),
64 log.warning(
"Fix your cmt/requirements file !!")
67 log.debug(
"No duplicates have been found: that's good !")
80 local[conf] = confDbGetConfigurable(conf)
84 """Return a dictionary representing the configuration.
85 The dictionary contains one entry per configurable which is a dictionary
86 with one entry per property.
87 The optional argument "all" is used to decide if to include only values
88 different from the default or all of them.
90 from GaudiKernel.Proxy.Configurable
import getNeededConfigurables
92 catalog = allConfigurables
97 if n
not in conf_dict:
99 for p, v
in catalog[n].getDefaultProperties().
items():
103 if n
not in conf_dict:
105 for p, v
in catalog[n].getValuedProperties().
items():
108 keys = conf_dict.keys()
112 ret_dict[n] = conf_dict[n]
117 """Helper function to get a configurable with the given name regardless
119 If defaultType can be a class derived from configurable or a string. If not
120 specified, the tool name is used as type."""
121 if name
in allConfigurables:
122 return allConfigurables[name]
125 if defaultType
is None:
128 if type(defaultType)
is str:
130 if defaultType
in globals():
132 defaultType = globals()[defaultType]
137 defaultType = getattr(Configurables, defaultType)
138 return defaultType(name)