|
def | __init__ (self, descr, docString, default) |
|
def | checkType (self, obj, value) |
|
def | convertDefaultToBeSet (self, obj, default) |
|
def | convertValueToBeSet (self, obj, value) |
|
def | __get__ (self, obj, type=None) |
|
def | __set__ (self, obj, value) |
|
def | isHandle (self, value) |
|
def | isConfig (self, value) |
|
def | getDefaultConfigurable (self, typeAndName, requester) |
|
def | setDefault (self, value) |
|
def | getDefault (self) |
|
def | fullPropertyName (self, obj) |
|
def | __delete__ (self, obj) |
|
Definition at line 366 of file PropertyProxy.py.
◆ __init__()
def python.PropertyProxy.GaudiHandleArrayPropertyProxy.__init__ |
( |
|
self, |
|
|
|
descr, |
|
|
|
docString, |
|
|
|
default |
|
) |
| |
<descr>: the real property in the object instance (from __slots__)
<confTypeName>: string indicating the (base) class of allowed Configurables to be assigned.
<handleType>: real python handle type (e.g. PublicToolHandle, PrivateToolHandle, ...)
Reimplemented from python.PropertyProxy.PropertyProxy.
Definition at line 367 of file PropertyProxy.py.
367 def __init__( self, descr, docString, default ):
368 """<descr>: the real property in the object instance (from __slots__)
369 <confTypeName>: string indicating the (base) class of allowed Configurables to be assigned.
370 <handleType>: real python handle type (e.g. PublicToolHandle, PrivateToolHandle, ...)
372 GaudiHandlePropertyProxyBase.__init__( self, descr, docString, default,
type(default).handleType, GaudiHandleArray )
373 self.arrayType =
type(default)
◆ __delete__()
def 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 )
◆ __get__()
def python.PropertyProxy.GaudiHandlePropertyProxyBase.__get__ |
( |
|
self, |
|
|
|
obj, |
|
|
|
type = None |
|
) |
| |
|
inherited |
Reimplemented from python.PropertyProxy.PropertyProxy.
Definition at line 199 of file PropertyProxy.py.
199 def __get__( self, obj, type = None ):
201 return self.descr.__get__( obj, type )
202 except AttributeError:
205 default = obj.__class__.getDefaultProperty( self.descr.__name__ )
207 if obj.isPrinting():
return default
208 default = self.convertDefaultToBeSet( obj, default )
210 if self.isConfig(default):
214 default = copy.deepcopy(default)
219 self.__set__( obj, default )
220 elif isinstance(default,GaudiHandleArray):
224 default = copy.deepcopy(default)
231 self.__set__( obj, default )
234 except AttributeError
as e:
236 traceback.print_exc()
238 raise RuntimeError(
"AttributeError(%s)" % e.args)
240 return self.descr.__get__( obj, type )
◆ __set__()
def python.PropertyProxy.GaudiHandlePropertyProxyBase.__set__ |
( |
|
self, |
|
|
|
obj, |
|
|
|
value |
|
) |
| |
|
inherited |
Reimplemented from python.PropertyProxy.PropertyProxy.
Definition at line 243 of file PropertyProxy.py.
243 def __set__( self, obj, value ):
247 'can not change property "%s" of locked configurable "%s"' %
248 (self.descr.__name__, obj.getJobOptName()) )
252 if not obj._isInSetDefaults()
or obj
not in self.history:
253 value = self.convertValueToBeSet( obj, value )
255 self.descr.__set__( obj, value )
256 log.verbose(
"Setting %s = %r", self.fullPropertyName( obj ), value )
257 self.history.setdefault( obj, [] ).
append( value )
◆ checkType()
def python.PropertyProxy.GaudiHandleArrayPropertyProxy.checkType |
( |
|
self, |
|
|
|
obj, |
|
|
|
value |
|
) |
| |
Definition at line 376 of file PropertyProxy.py.
376 def checkType( self, obj, value ):
377 if not isinstance( value, list )
and not isinstance( value, self.arrayType ):
378 raise TypeError(
"%s: Value %r is not a list nor a %s" % \
379 ( self.fullPropertyName(obj), value, self.arrayType.__name__ ) )
◆ convertDefaultToBeSet()
def python.PropertyProxy.GaudiHandleArrayPropertyProxy.convertDefaultToBeSet |
( |
|
self, |
|
|
|
obj, |
|
|
|
default |
|
) |
| |
Reimplemented from python.PropertyProxy.GaudiHandlePropertyProxyBase.
Definition at line 382 of file PropertyProxy.py.
382 def convertDefaultToBeSet( self, obj, default ):
383 self.checkType( obj, default )
384 newDefault = self.arrayType()
386 cd = GaudiHandlePropertyProxyBase.convertDefaultToBeSet( self, obj, d )
387 if cd: newDefault.append( cd )
◆ convertValueToBeSet()
def python.PropertyProxy.GaudiHandleArrayPropertyProxy.convertValueToBeSet |
( |
|
self, |
|
|
|
obj, |
|
|
|
value |
|
) |
| |
◆ fullPropertyName()
def 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__
◆ getDefault()
def python.PropertyProxy.PropertyProxy.getDefault |
( |
|
self | ) |
|
|
inherited |
◆ getDefaultConfigurable()
def python.PropertyProxy.GaudiHandlePropertyProxyBase.getDefaultConfigurable |
( |
|
self, |
|
|
|
typeAndName, |
|
|
|
requester |
|
) |
| |
|
inherited |
Return the configurable instance corresponding to the toolhandle if possible.
Otherwise return None
Definition at line 270 of file PropertyProxy.py.
270 def getDefaultConfigurable(self,typeAndName,requester):
271 """Return the configurable instance corresponding to the toolhandle if possible.
272 Otherwise return None"""
275 typeAndNameTuple = typeAndName.split(
'/')
276 confType = typeAndNameTuple[0]
277 confClass = ConfigurableDb.getConfigurable(confType)
280 log.error(
"%s: Configurable %s is not a %s",
281 requester, confType, self._confTypeName )
284 confName = typeAndNameTuple[1]
288 return confClass(confName)
◆ isConfig()
def python.PropertyProxy.GaudiHandlePropertyProxyBase.isConfig |
( |
|
self, |
|
|
|
value |
|
) |
| |
|
inherited |
Check if <value> is a configurable of the correct type
Definition at line 265 of file PropertyProxy.py.
265 def isConfig(self,value):
266 """Check if <value> is a configurable of the correct type"""
◆ isHandle()
def python.PropertyProxy.GaudiHandlePropertyProxyBase.isHandle |
( |
|
self, |
|
|
|
value |
|
) |
| |
|
inherited |
Check if <value> is a handle of the correct type
Definition at line 260 of file PropertyProxy.py.
260 def isHandle(self,value):
261 """Check if <value> is a handle of the correct type"""
262 return isinstance(value,self._handleType)
◆ setDefault()
def python.PropertyProxy.PropertyProxy.setDefault |
( |
|
self, |
|
|
|
value |
|
) |
| |
|
inherited |
Definition at line 85 of file PropertyProxy.py.
85 def setDefault( self, value ):
86 self.__default = value
◆ __default
python.PropertyProxy.PropertyProxy.__default |
|
privateinherited |
◆ __doc__
python.PropertyProxy.PropertyProxy.__doc__ |
|
privateinherited |
◆ _confTypeName
python.PropertyProxy.GaudiHandlePropertyProxyBase._confTypeName |
|
privateinherited |
◆ _handleType
python.PropertyProxy.GaudiHandlePropertyProxyBase._handleType |
|
privateinherited |
◆ arrayType
python.PropertyProxy.GaudiHandleArrayPropertyProxy.arrayType |
◆ descr
python.PropertyProxy.PropertyProxy.descr |
|
inherited |
◆ history
python.PropertyProxy.PropertyProxy.history |
|
inherited |
◆ default
The documentation for this class was generated from the following file: