The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
GaudiPython.Bindings.PropertyEntry Class Reference
Inheritance diagram for GaudiPython.Bindings.PropertyEntry:
Collaboration diagram for GaudiPython.Bindings.PropertyEntry:

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 235 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 238 of file Bindings.py.

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

Member Function Documentation

◆ documentation()

GaudiPython.Bindings.PropertyEntry.documentation ( self)

Definition at line 272 of file Bindings.py.

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

◆ hasDoc()

GaudiPython.Bindings.PropertyEntry.hasDoc ( self)

Definition at line 275 of file Bindings.py.

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

◆ property()

GaudiPython.Bindings.PropertyEntry.property ( self)

Definition at line 268 of file Bindings.py.

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

◆ ptype()

GaudiPython.Bindings.PropertyEntry.ptype ( self)

Definition at line 265 of file Bindings.py.

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

◆ value()

GaudiPython.Bindings.PropertyEntry.value ( self)

Definition at line 262 of file Bindings.py.

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

Member Data Documentation

◆ __doc__

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

Definition at line 240 of file Bindings.py.

◆ _property

GaudiPython.Bindings.PropertyEntry._property = prop
protected

Definition at line 260 of file Bindings.py.

◆ _type

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

Definition at line 239 of file Bindings.py.

◆ _value

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

Definition at line 243 of file Bindings.py.


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