Package esys :: Package escript :: Module modelframe :: Class Link
[hide private]
[frames] | no frames]

Class Link

A Link makes an attribute of an object callable:

   o.object()
   o.a=8
   l=Link(o,"a")
   assert l()==8
Instance Methods [hide private]
 
__call__(self, name=None)
Returns the value of the attribute of the target object.
 
__init__(self, target, attribute=None)
Creates a link to the object target.
 
__repr__(self)
Returns a string representation of the link.
 
getAttributeName(self)
Returns the name of the attribute the link is pointing to.
 
getTarget(self)
Returns the target.
 
hasDefinedAttributeName(self)
Returns true if an attribute name is set.
 
setAttributeName(self, attribute)
Sets a new attribute name to be collected from the target object.
 
toDom(self, esysxml, node)
toDom method of Link.
Class Methods [hide private]
 
fromDom(cls, esysxml, node)
Method Details [hide private]

__call__(self, name=None)
(Call operator)

 

Returns the value of the attribute of the target object. If the attribute is callable then the return value of the call is returned.

__init__(self, target, attribute=None)
(Constructor)

 

Creates a link to the object target. If attribute is given, the link is established to this attribute of the target. Otherwise the attribute is undefined.

setAttributeName(self, attribute)

 

Sets a new attribute name to be collected from the target object. The target object must have the attribute with name attribute.

toDom(self, esysxml, node)

 

toDom method of Link. Creates a Link node and appends it to the current XML esysxml.