ATLAS Offline Software
Classes | Functions | Variables
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

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

Variables

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

Function Documentation

◆ _get_prop_value()

def python.Configurables._get_prop_value (   pycomp,
  propname 
)
private

Definition at line 32 of file Configurables.py.

32 def _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()

def python.Configurables._install_fancy_attrs ( )
private
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.

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)

◆ _is_pycomp()

def python.Configurables._is_pycomp (   obj)
private

Definition at line 256 of file Configurables.py.

256 def _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
private

Definition at line 121 of file Configurables.py.

◆ _aud_base

python.Configurables._aud_base = ConfigurableAuditor
private

Definition at line 126 of file Configurables.py.

◆ _svc_base

python.Configurables._svc_base = ConfigurableService
private

Definition at line 124 of file Configurables.py.

◆ _tool_base

python.Configurables._tool_base = ConfigurableAlgTool
private

Definition at line 125 of file Configurables.py.

python.Configurables._install_fancy_attrs
def _install_fancy_attrs()
Definition: Configurables.py:262
python.Configurables._is_pycomp
def _is_pycomp(obj)
Definition: Configurables.py:256
python.Configurables._get_prop_value
def _get_prop_value(pycomp, propname)
Definition: Configurables.py:32
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7