SCons :: Util :: Proxy :: Class Proxy
[hide private]
[frames] | no frames]

Class Proxy

source code

Known Subclasses:

A simple generic Proxy class, forwarding all calls to subject. So, for the benefit of the python newbie, what does this really mean? Well, it means that you can take an object, let's call it 'objA', and wrap it in this Proxy class, with a statement like this

proxyObj = Proxy(objA),

Then, if in the future, you do something like this

x = proxyObj.var1,

since Proxy does not have a 'var1' attribute (but presumably objA does), the request actually is equivalent to saying

x = objA.var1

Inherit from this class to create a Proxy.

Instance Methods [hide private]
__init__(self, subject)
Wrap an object as a Proxy object
source code
__getattr__(self, name)
Retrieve an attribute from the wrapped object.
source code
Retrieve the entire wrapped object
source code
__cmp__(self, other) source code
Method Details [hide private]

__getattr__(self, name)
(Qualification operator)

source code 
Retrieve an attribute from the wrapped object. If the named attribute doesn't exist, AttributeError is raised