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]]),
66 log.debug(
"No duplicates have been found: that's good !")
76 local[conf] = confDbGetConfigurable(conf)
80 """Return a dictionary representing the configuration.
81 The dictionary contains one entry per configurable which is a dictionary
82 with one entry per property.
83 The optional argument "all" is used to decide if to include only values
84 different from the default or all of them.
86 from GaudiKernel.Proxy.Configurable
import getNeededConfigurables
88 catalog = allConfigurables
93 if n
not in conf_dict:
95 for p, v
in catalog[n].getDefaultProperties().items():
99 if n
not in conf_dict:
101 for p, v
in catalog[n].getValuedProperties().items():
104 keys = conf_dict.keys()
108 ret_dict[n] = conf_dict[n]
113 """Helper function to get a configurable with the given name regardless
115 If defaultType can be a class derived from configurable or a string. If not
116 specified, the tool name is used as type."""
117 if name
in allConfigurables:
118 return allConfigurables[name]
121 if defaultType
is None:
124 if isinstance(defaultType, str):
126 if defaultType
in globals():
128 defaultType = globals()[defaultType]
133 defaultType = getattr(Configurables, defaultType)
134 return defaultType(name)