FIX _aq_path
parent
13bf9c6ad3
commit
b0ab3694e3
|
@ -89,14 +89,24 @@ class AquisitionProxy:
|
|||
if name.startswith("_aq_"):
|
||||
if (name == "_aq_parent"):
|
||||
return object.__getattribute__( self, "_p")
|
||||
# return AquisitionProxy( p, self, aq_name=p._aq_name, aq_root=self._aq_root )
|
||||
if (name == "_aq_name"):
|
||||
n = object.__getattribute__( self, "_aq_name")
|
||||
if n is None:
|
||||
return "/"
|
||||
return ""
|
||||
return n
|
||||
if (name == "_aq_object"):
|
||||
return object.__getattribute__( self, "_o")
|
||||
if (name == "_aq_path"):
|
||||
try:
|
||||
return object.__getattribute__( self, "_aq_path" )
|
||||
except:
|
||||
p = object.__getattribute__( self, "_p")
|
||||
if p is None:
|
||||
return (self,)
|
||||
else:
|
||||
aqp = p._aq_path + (self,)
|
||||
object.__setattr__( self, "_aq_path", aqp )
|
||||
return aqp
|
||||
|
||||
return object.__getattribute__( self, name )
|
||||
|
||||
|
@ -108,8 +118,10 @@ class AquisitionProxy:
|
|||
v = getattr( object.__getattribute__( self, "_o"), name )
|
||||
except AttributeError as ae:
|
||||
try:
|
||||
print("AQN_PARENT: %s %s" % (object.__getattribute__( self, "_p"), name))
|
||||
v = getattr( object.__getattribute__( self, "_p"), name)
|
||||
_aq_parent = object.__getattribute__( self, "_p")
|
||||
print("AQN_PARENT: %s %s" % (_aq_parent, name))
|
||||
v = getattr( _aq_parent, name)
|
||||
|
||||
if (isinstance(v, AquisitionProxy)):
|
||||
v = object.__getattribute__( v, "_o" )
|
||||
except AttributeError as ae2:
|
||||
|
@ -157,8 +169,8 @@ class AquisitionProxy:
|
|||
|
||||
return ls
|
||||
|
||||
def _aq_path(self):
|
||||
if (self._aq_name is None) or (self._aq_parent is None):
|
||||
return ""
|
||||
return "%s/%s" % (self._aq_parent._aq_path(),self._aq_name)
|
||||
# def _aq_path(self):
|
||||
# if (self._aq_name is None) or (self._aq_parent is None):
|
||||
# return ""
|
||||
# return "%s/%s" % (self._aq_parent._aq_path(),self._aq_name)
|
||||
|
||||
|
|
Loading…
Reference in New Issue