The Gaudi Framework  master (9f3f8895)
Loading...
Searching...
No Matches
GaudiPython.Bindings.PropertyEntry Class Reference

Public Member Functions

 __init__ (self, prop)
 value (self)
 ptype (self)
 property (self)
 documentation (self)
 hasDoc (self)

Protected Attributes

 _type = type(prop).__name__
 _value = prop.value()
 _property = prop

Private Attributes

str __doc__ = " --- Property type is " + self.ptype()

Detailed Description

holds the value and the documentation string of a property

Definition at line 234 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiPython.Bindings.PropertyEntry.__init__ ( self,
prop )

Definition at line 237 of file Bindings.py.

237 def __init__(self, prop):
238 self._type = type(prop).__name__
239 self.__doc__ = " --- Property type is " + self.ptype()
240
241 if isinstance(prop, GaudiHandleProperty):
242 self._value = prop.value() # do nothing for ATLAS' handles
243 elif isinstance(prop, GaudiHandleArrayProperty):
244 self._value = prop.value() # do nothing for ATLAS' handles
245 else:
246 # for all other types try to extract the native python type
247 try:
248 self._value = eval(prop.toString(), {}, {})
249 except Exception:
250 if hasattr(prop, "value"):
251 self._value = prop.value()
252 else:
253 self._value = prop.toString()
254
255 self.__doc__ += " --- Default value = " + str(self._value) + " --- "
256 if prop.documentation() != "none":
257 self.__doc__ = prop.documentation() + "\\n" + self.__doc__
258 # keep the original property
259 self._property = prop # property itself
260

Member Function Documentation

◆ documentation()

GaudiPython.Bindings.PropertyEntry.documentation ( self)

Definition at line 271 of file Bindings.py.

271 def documentation(self):
272 return self.__doc__
273

◆ hasDoc()

GaudiPython.Bindings.PropertyEntry.hasDoc ( self)

Definition at line 274 of file Bindings.py.

274 def hasDoc(self):
275 return len(self.__doc__) > 0 and self.__doc__ != "none"
276
277
278# ----iProperty class----------------------------------------------------------
279
280

◆ property()

GaudiPython.Bindings.PropertyEntry.property ( self)

Definition at line 267 of file Bindings.py.

267 def property(self):
268 "Return the underlying property itself"
269 return self._property
270

◆ ptype()

GaudiPython.Bindings.PropertyEntry.ptype ( self)

Definition at line 264 of file Bindings.py.

264 def ptype(self):
265 return self._type
266

◆ value()

GaudiPython.Bindings.PropertyEntry.value ( self)

Definition at line 261 of file Bindings.py.

261 def value(self):
262 return self._value
263

Member Data Documentation

◆ __doc__

GaudiPython.Bindings.PropertyEntry.__doc__ = " --- Property type is " + self.ptype()
private

Definition at line 239 of file Bindings.py.

◆ _property

GaudiPython.Bindings.PropertyEntry._property = prop
protected

Definition at line 259 of file Bindings.py.

◆ _type

GaudiPython.Bindings.PropertyEntry._type = type(prop).__name__
protected

Definition at line 238 of file Bindings.py.

◆ _value

GaudiPython.Bindings.PropertyEntry._value = prop.value()
protected

Definition at line 242 of file Bindings.py.


The documentation for this class was generated from the following file: