ATLAS Offline Software
Loading...
Searching...
No Matches
python.Configurables Namespace Reference

Classes

class  _PyCompHandle
class  CfgPyAlgorithm
 Configurable base class for PyAlgorithms -------------------------------—. More...
class  CfgPyAlgTool
class  CfgPyAud
class  CfgPyComponent
 Configurable base class for all Py compmonents -------------------------—. More...
class  CfgPyService
class  PyComponents

Functions

 _get_prop_value (pycomp, propname)
 _is_pycomp (obj)
 _install_fancy_attrs ()

Variables

 _alg_base = GaudiConfig2.Configurable
 _svc_base = ConfigurableService
 _tool_base = ConfigurableAlgTool
 _aud_base = ConfigurableAuditor

Function Documentation

◆ _get_prop_value()

python.Configurables._get_prop_value ( pycomp,
propname )
protected

Definition at line 32 of file Configurables.py.

32def _get_prop_value(pycomp, propname):
33 v = pycomp.properties()[propname]
34 if v == pycomp.propertyNoValue:
35 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
36 if propname == 'OutputLevel' and hasattr (svcMgr, 'MessageSvc'):
37 # special case of OutputLevel...
38 v = getattr(svcMgr.MessageSvc, propname)
39 else:
40 v = pycomp.getDefaultProperty(propname)
41 pass
42 return v
43
44

◆ _install_fancy_attrs()

python.Configurables._install_fancy_attrs ( )
protected
loop over all pycomponents, inspect their attributes and install
a handle in place of (sub) pycomponents to trigger the auto-initialize
behaviour of (C++) XyzHandles.

Definition at line 262 of file Configurables.py.

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)
MsgStream & msg
Definition testRead.cxx:32

◆ _is_pycomp()

python.Configurables._is_pycomp ( obj)
protected

Definition at line 256 of file Configurables.py.

256def _is_pycomp(obj):
257 return isinstance(
258 obj,
259 (CfgPyAlgorithm, CfgPyService, CfgPyAlgTool, CfgPyAud)
260 )
261

Variable Documentation

◆ _alg_base

python.Configurables._alg_base = GaudiConfig2.Configurable
protected

Definition at line 121 of file Configurables.py.

◆ _aud_base

python.Configurables._aud_base = ConfigurableAuditor
protected

Definition at line 126 of file Configurables.py.

◆ _svc_base

python.Configurables._svc_base = ConfigurableService
protected

Definition at line 124 of file Configurables.py.

◆ _tool_base

python.Configurables._tool_base = ConfigurableAlgTool
protected

Definition at line 125 of file Configurables.py.