178def _getAllOpts_old(explicit_defaults=False):
179 """
180 Return all options from the old configuration system as a dictionary.
181
182 If explicit_defaults is true, include default values of unset properties in the dictionary.
183 """
184 from itertools import chain
185
186 from GaudiKernel.Proxy.Configurable import Configurable, getNeededConfigurables
187
188 old_opts = {}
189
190
191
192 done_conf = set()
193
194
195
196 while True:
197 needed_conf = [n for n in getNeededConfigurables() if n not in done_conf]
198 if not needed_conf:
199 break
200
201 for n in needed_conf:
202 done_conf.add(n)
203 c = Configurable.allConfigurables[n]
204 items = getattr(c, "getValuedProperties", dict)().items()
205 if explicit_defaults:
206 items = chain(c.getDefaultProperties().items(), items)
207 for p, v in items:
208
209 if hasattr(Configurable, "PropertyReference") and isinstance(
210 v, Configurable.PropertyReference
211 ):
212
213
214 v = v.__resolve__()
215 if hasattr(v, "__opt_value__"):
216 v = v.__opt_value__()
217 elif isinstance(v, str):
218 v = repr(v)
219 else:
220 v = str(v)
221 old_opts[".".join((n, p))] = v
222
223 return old_opts
224
225