Python binding: ProxyObject questions

John (J5) Palmieri johnp at redhat.com
Fri Aug 25 08:27:44 PDT 2006


On Fri, 2006-08-25 at 16:57 +0700, Jeroen T. Vermeulen wrote:
> On Thu, August 24, 2006 23:37, John (J5) Palmieri wrote:
> 
> > I wrote it as a cast, so you cast the proxy to the interface.  The other
> > way of doing it is proxy.method(dbus_interface="...")
> 
> A cast sounds like a nice trick.  From what I can see so far there's just
> no way to add Python methods to a proxy that would be guaranteed not to
> clash with the dbus object's methods...

There is one way.  Put an underscore as the first character i.e.
_connect.  D-Bus methods need to start with a letter.

> Does the name-clash problem exist also with dbus methods having parameters
> called "dbus_interface," by the way?

No since we don't have named parameters in D-Bus.

> > It is a holdover from the way old bindings.  I had a good answer for why
> > it doesn't clash at one point.  I can't remember it now.  I don't
> > recommend that API in any case since the service has to be running in
> > order to connect to the signal.  The python bindings are due for an
> > overhaul.  Jdahlin wants to change them completely.
> 
> I was about to document the basics of the Python API in my new tutorial...
>  Do you think it would be better to hold off on that?

Documenting them would be a great way for us to make sure we keep
backwards compat.  We need to do that because we don't want to leave
projects like OLPC out in the cold.  Plus they will help in the design
of the new API.

-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list