a class to mimic the gaudi C++ {Tool,Svc}Handle classes: automatic call
to `initialize` when __getattr__ is called on the instance.
Definition at line 209 of file Configurables.py.
◆ __init__()
def python.Configurables._PyCompHandle.__init__ |
( |
|
self, |
|
|
|
parent, |
|
|
|
attr_name |
|
) |
| |
Definition at line 213 of file Configurables.py.
213 def __init__(self, parent, attr_name):
214 msg = parent.msg.verbose
216 parentName=parent.name()
218 parentName=parent.name
219 msg(
'installing py-comp-handle for [%s.%s]...',
220 parentName, attr_name)
221 self.__dict__.update({
224 '_attr': getattr(parent, attr_name),
225 '_init_called':
False,
227 msg(
'installing py-comp-handle for [%s.%s]... [done]',
228 parentName, attr_name)
◆ __getattribute__()
def python.Configurables._PyCompHandle.__getattribute__ |
( |
|
self, |
|
|
|
n |
|
) |
| |
Definition at line 241 of file Configurables.py.
241 def __getattribute__(self, n):
242 if n.startswith(
'_'):
243 return super().__getattribute__(n)
244 obj = self.__dict__[
'_attr']
246 return getattr(obj, n)
◆ __setattr__()
def python.Configurables._PyCompHandle.__setattr__ |
( |
|
self, |
|
|
|
n, |
|
|
|
v |
|
) |
| |
Definition at line 248 of file Configurables.py.
249 if n.startswith(
'_'):
251 obj = self.__dict__[
'_attr']
253 return setattr(obj, n, v)
◆ _init_once()
def python.Configurables._PyCompHandle._init_once |
( |
|
self, |
|
|
|
obj |
|
) |
| |
|
private |
Definition at line 231 of file Configurables.py.
231 def _init_once(self, obj):
232 if self.__dict__[
'_init_called']:
234 parent = self.__dict__[
'_parent']
237 self.__dict__[
'_init_called'] =
True
239 setattr(parent, self.__dict__[
'_name'], obj)
The documentation for this class was generated from the following file: