SCons ::
Util ::
Proxy ::
Class Proxy
|
|
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.
|
__init__(self,
subject)
Wrap an object as a Proxy object |
source code
|
|
|
|
|
get(self)
Retrieve the entire wrapped object |
source code
|
|
|
|
__getattr__(self,
name)
(Qualification operator)
| source code
|
Retrieve an attribute from the wrapped object. If the named
attribute doesn't exist, AttributeError is raised
|