262def _install_fancy_attrs():
263 """loop over all pycomponents, inspect their attributes and install
264 a handle in place of (sub) pycomponents to trigger the auto-initialize
265 behaviour of (C++) XyzHandles.
266 """
267 import PyUtils.Logging as L
268 msg = L.logging.getLogger('PyComponentMgr').verbose
269 comps = PyComponents.instances.items()
270 ncomps = len(comps)
271 msg(
'installing fancy getattrs... (%i)', ncomps)
272 for k,comp in comps:
273 msg(
'handling [%s]...', k)
274 for attr_name, attr in comp.__dict__.items():
275 if _is_pycomp(attr):
276 msg(
' ==> [%s]...', attr_name)
277 setattr(comp, attr_name,
278 _PyCompHandle(parent=comp, attr_name=attr_name))
279 msg(
' ==> [%s]... [done]', attr_name)
280 msg(
'installing fancy getattrs... (%i) [done]',ncomps)