The Gaudi Framework  v36r16 (ea80daf8)
GaudiPython.Bindings.PropertyEntry Class Reference
Inheritance diagram for GaudiPython.Bindings.PropertyEntry:
Collaboration diagram for GaudiPython.Bindings.PropertyEntry:

Public Member Functions

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

Private Attributes

 _type
 
 __doc__
 
 _value
 
 _property
 

Detailed Description

holds the value and the documentation string of a property

Definition at line 240 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 243 of file Bindings.py.

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

Member Function Documentation

◆ documentation()

def GaudiPython.Bindings.PropertyEntry.documentation (   self)

Definition at line 277 of file Bindings.py.

277  def documentation(self):
278  return self.__doc__
279 

◆ hasDoc()

def GaudiPython.Bindings.PropertyEntry.hasDoc (   self)

Definition at line 280 of file Bindings.py.

280  def hasDoc(self):
281  return len(self.__doc__) > 0 and self.__doc__ != "none"
282 
283 
284 # ----iProperty class----------------------------------------------------------
285 
286 

◆ property()

def GaudiPython.Bindings.PropertyEntry.property (   self)

Definition at line 273 of file Bindings.py.

273  def property(self):
274  "Return the underlying property itself"
275  return self._property
276 

◆ ptype()

def GaudiPython.Bindings.PropertyEntry.ptype (   self)

Definition at line 270 of file Bindings.py.

270  def ptype(self):
271  return self._type
272 

◆ value()

def GaudiPython.Bindings.PropertyEntry.value (   self)

Definition at line 267 of file Bindings.py.

267  def value(self):
268  return self._value
269 

Member Data Documentation

◆ __doc__

GaudiPython.Bindings.PropertyEntry.__doc__
private

Definition at line 245 of file Bindings.py.

◆ _property

GaudiPython.Bindings.PropertyEntry._property
private

Definition at line 265 of file Bindings.py.

◆ _type

GaudiPython.Bindings.PropertyEntry._type
private

Definition at line 244 of file Bindings.py.

◆ _value

GaudiPython.Bindings.PropertyEntry._value
private

Definition at line 248 of file Bindings.py.


The documentation for this class was generated from the following file:
gaudirun.type
type
Definition: gaudirun.py:162