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

Class LinkableObject

object --+
         |
        LinkableObject
Known Subclasses:

An object that allows to link its attributes to attributes of other objects via a Link object. For instance:

   p = LinkableObject()
   p.x = Link(o,"name")
   print p.x

links attribute x of p to the attribute name of object o.

p.x will contain the current value of attribute name of object o.

If the value of getattr(o, "name") is callable, p.x will return the return value of the call.

Instance Methods [hide private]
 
__delattr__(self, name)
Removes the attribute name.
 
__getattr__(self, name)
Returns the value of attribute name.
 
__init__(self, id=None, debug=False)
Initializes LinkableObject so that we can operate on Links.
 
__setattr__(self, name, value)
Sets the value for attribute name.
 
getAttributeObject(self, name)
Returns the object stored for attribute name.
 
hasAttribute(self, name)
Returns True if self has attribute name.
 
trace(self, msg)
If debugging is on, prints the message, otherwise does nothing.

Inherited from object: __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__delattr__(self, name)

 

Removes the attribute name.

Overrides: object.__delattr__

__getattr__(self, name)
(Qualification operator)

 

Returns the value of attribute name. If the value is a Link object the object is called and the return value is returned.

__init__(self, id=None, debug=False)
(Constructor)

 

Initializes LinkableObject so that we can operate on Links.

Overrides: object.__init__

__setattr__(self, name, value)

 

Sets the value for attribute name. If value is a Link the target attribute is set to name if no attribute has been specified.

Overrides: object.__setattr__