Python binding: ProxyObject questions

Jeroen T. Vermeulen jtv at xs4all.nl
Thu Aug 24 00:18:23 PDT 2006


Hello everyone,

I'm working on an "introduction to dbus" document that can hopefully merge
with the tutorial someday.  (More about that in another post, to keep
things on-topic and avoid duplication.)

Here's a question I came across w.r.t. the Python binding: when looking
for a particular interface of some object you have a proxy to, why can't
you just get it from the proxy?  It would seem to make more sense to say
e.g. "proxy.interface(i)" than "bus.Interface(proxy, i)".

At first I thought the answer was obvious: the proxy transparently exports
all members of the dbus object it represents, and we wouldn't want name
clashes between the proxy's (python) methods and the (dbus) object's
methods.  But then why does ProxyObject have a (python) method
connect_to_signal?  Is that a reserved name that objects aren't allowed to
use, or is there something else going on?

If there are reserved names, or at least if ProxyObject can be one
(python) member name that can't ever belong to a (dbus) member, then
perhaps that would be a good place to add (python) members to the proxy
that aren't (dbus) object members...

Finally, a real nitpick: why is this class called ProxyObject? 
ObjectProxy would make more sense to me, since it represents a proxy to a
(dbus) object.  ProxyObject seems to make it explicit that objects of this
class are objects in the Python sense--and that is obvious from the fact
that it's a Python class in the first place.


Jeroen




More information about the dbus mailing list