|
def | __init__ (self, descr, docString=None, default=None) |
|
def | setDefault (self, value) |
|
def | getDefault (self) |
|
def | fullPropertyName (self, obj) |
|
def | __get__ (self, obj, type=None) |
|
def | __set__ (self, obj, value) |
|
def | __delete__ (self, obj) |
|
Definition at line 76 of file PropertyProxy.py.
◆ __init__()
def python.PropertyProxy.PropertyProxy.__init__ |
( |
|
self, |
|
|
|
descr, |
|
|
|
docString = None , |
|
|
|
default = None |
|
) |
| |
◆ __delete__()
def python.PropertyProxy.PropertyProxy.__delete__ |
( |
|
self, |
|
|
|
obj |
|
) |
| |
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.PropertyProxy.__get__ |
( |
|
self, |
|
|
|
obj, |
|
|
|
type = None |
|
) |
| |
Reimplemented in python.PropertyProxy.DataHandlePropertyProxy, and python.PropertyProxy.GaudiHandlePropertyProxyBase.
Definition at line 96 of file PropertyProxy.py.
96 def __get__( self, obj, type = None ):
99 value = self.descr.__get__( obj, type )
100 except AttributeError:
104 if self.__default.__class__ == list
or self.__default.__class__ == set:
105 self.descr.__set__( obj, self.__default.__class__(self.__default) )
106 value = self.descr.__get__( obj, type )
111 value = self.descr.__get__( obj, type )
116 if builtins.type( value )
is dict:
117 from ctypes
import pythonapi, py_object
118 from _ctypes
import PyObj_FromPtr
119 PyDictProxy_New = pythonapi.PyDictProxy_New
120 PyDictProxy_New.argtypes = (py_object,)
121 PyDictProxy_New.rettype = py_object
122 value = PyObj_FromPtr( PyDictProxy_New( value ) )
123 elif builtins.type( value )
is list:
124 value = tuple( value )
127 value = copy.copy( value )
◆ __set__()
def python.PropertyProxy.PropertyProxy.__set__ |
( |
|
self, |
|
|
|
obj, |
|
|
|
value |
|
) |
| |
Reimplemented in python.PropertyProxy.DataHandlePropertyProxy, and python.PropertyProxy.GaudiHandlePropertyProxyBase.
Definition at line 131 of file PropertyProxy.py.
131 def __set__( self, obj, value ):
135 'can not change property "%s" of locked configurable "%s"' %
136 (self.descr.__name__, obj.getJobOptName()) )
140 if hasattr( self,
'default' ):
141 proptype =
type(self.default)
142 elif obj
in self.history:
143 proptype =
type( self.history[ obj ][ 0 ] )
146 if proptype
and not isinstance(proptype,
type(
None)):
148 value =
_isCompatible( proptype, value, self.fullPropertyName(obj) )
151 if proptype == tuple
or proptype == list:
153 oldvec = self.descr.__get__( obj, type )
155 tpo =
type(oldvec[0])
158 except AttributeError:
164 if not obj._isInSetDefaults()
or obj
not in self.history:
166 if hasattr( self,
'default' )
and self.default
is None:
167 obj.__iadd__( value, self.descr )
169 self.descr.__set__( obj, value )
170 self.history.setdefault( obj, [] ).
append( value )
◆ fullPropertyName()
def python.PropertyProxy.PropertyProxy.fullPropertyName |
( |
|
self, |
|
|
|
obj |
|
) |
| |
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 | ) |
|
◆ setDefault()
def python.PropertyProxy.PropertyProxy.setDefault |
( |
|
self, |
|
|
|
value |
|
) |
| |
Definition at line 85 of file PropertyProxy.py.
85 def setDefault( self, value ):
86 self.__default = value
◆ __default
python.PropertyProxy.PropertyProxy.__default |
|
private |
◆ __doc__
python.PropertyProxy.PropertyProxy.__doc__ |
|
private |
◆ descr
python.PropertyProxy.PropertyProxy.descr |
◆ history
python.PropertyProxy.PropertyProxy.history |
◆ default
The documentation for this class was generated from the following file: