ATLAS Offline Software
Loading...
Searching...
No Matches
python.PropertyProxy.DataHandlePropertyProxy Class Reference
Inheritance diagram for python.PropertyProxy.DataHandlePropertyProxy:
Collaboration diagram for python.PropertyProxy.DataHandlePropertyProxy:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self, descr, docString, default)
 __get__ (self, obj, type=None)
 __set__ (self, obj, value)
 convertValueToBeSet (self, obj, value)
 setDefault (self, value)
 getDefault (self)
 fullPropertyName (self, obj)
 __delete__ (self, obj)

Public Attributes

 history = weakref.WeakKeyDictionary()
 descr = descr

Properties

 default = property( getDefault, setDefault )

Private Attributes

 __doc__ = docString
 __default = value

Detailed Description

Definition at line 401 of file PropertyProxy.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

python.PropertyProxy.DataHandlePropertyProxy.__init__ ( self,
descr,
docString,
default )

Definition at line 402 of file PropertyProxy.py.

402 def __init__(self, descr, docString, default):
403 PropertyProxy.__init__(self, descr, docString, default)
404

Member Function Documentation

◆ __delete__()

python.PropertyProxy.PropertyProxy.__delete__ ( self,
obj )
inherited

Definition at line 172 of file PropertyProxy.py.

172 def __delete__( self, obj ):
173 if obj in self.history:
174 del self.history[ obj ]
175 self.descr.__delete__( obj )
176
177
178

◆ __get__()

python.PropertyProxy.DataHandlePropertyProxy.__get__ ( self,
obj,
type = None )

Definition at line 405 of file PropertyProxy.py.

405 def __get__(self, obj, type=None):
406 try:
407 return self.descr.__get__(obj, type)
408 except AttributeError:
409 # Get default
410 try:
411 default = obj.__class__.getDefaultProperty(self.descr.__name__)
412 default = self.convertValueToBeSet(obj, default)
413 if default:
414 self.__set__(obj, default)
415 except AttributeError as e:
416 # change type of exception to avoid false error message
417 raise RuntimeError(*e.args)
418
419 return self.descr.__get__(obj, type)
420

◆ __set__()

python.PropertyProxy.DataHandlePropertyProxy.__set__ ( self,
obj,
value )

Definition at line 421 of file PropertyProxy.py.

421 def __set__(self, obj, value):
422 if not obj._isInSetDefaults() or obj not in self.history:
423 value = self.convertValueToBeSet(obj, value)
424 # assign the value
425 self.descr.__set__(obj, value)
426 log.debug("Setting %s = %r", self.fullPropertyName(obj), value)
427 self.history.setdefault(obj, []).append(value)
428

◆ convertValueToBeSet()

python.PropertyProxy.DataHandlePropertyProxy.convertValueToBeSet ( self,
obj,
value )

Definition at line 429 of file PropertyProxy.py.

429 def convertValueToBeSet(self, obj, value):
430 if value is None:
431 value = ''
432
433 mode = obj.__class__.getDefaultProperty(self.descr.__name__).mode()
434 _type = obj.__class__.getDefaultProperty(self.descr.__name__).type()
435 if type(value) is str:
436 return DataHandle(value, mode, _type)
437 elif isinstance(value, DataHandle):
438 return DataHandle(value.__str__(), mode, _type)
439 else:
440 raise ValueError("received an instance of %s, but %s expected" %
441 (type(value), 'str or DataHandle'))
442
443
an iterator over instances of a given type in StoreGateSvc.
Definition DataHandle.h:43

◆ fullPropertyName()

python.PropertyProxy.PropertyProxy.fullPropertyName ( self,
obj )
inherited

Definition at line 93 of file PropertyProxy.py.

93 def fullPropertyName( self, obj ):
94 return (obj.getJobOptName() or obj.getName()) + '.' + self.descr.__name__
95

◆ getDefault()

python.PropertyProxy.PropertyProxy.getDefault ( self)
inherited

Definition at line 88 of file PropertyProxy.py.

88 def getDefault( self ):
89 return self.__default
90

◆ setDefault()

python.PropertyProxy.PropertyProxy.setDefault ( self,
value )
inherited

Definition at line 85 of file PropertyProxy.py.

85 def setDefault( self, value ):
86 self.__default = value
87

Member Data Documentation

◆ __default

python.PropertyProxy.PropertyProxy.__default = value
privateinherited

Definition at line 86 of file PropertyProxy.py.

◆ __doc__

python.PropertyProxy.PropertyProxy.__doc__ = docString
privateinherited

Definition at line 81 of file PropertyProxy.py.

◆ descr

python.PropertyProxy.PropertyProxy.descr = descr
inherited

Definition at line 79 of file PropertyProxy.py.

◆ history

python.PropertyProxy.PropertyProxy.history = weakref.WeakKeyDictionary()
inherited

Definition at line 78 of file PropertyProxy.py.

Property Documentation

◆ default

python.PropertyProxy.PropertyProxy.default = property( getDefault, setDefault )
staticinherited

Definition at line 91 of file PropertyProxy.py.


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