dbus-python and exposing properties

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Oct 24 04:51:44 PDT 2014


On 23/10/14 18:02, Andy Grover wrote:
>> because I'm assuming calling GetAll is how the introspection is finding
>> what properties are supported, and thus the above would register three
>> properties named foo, bar, and baz.

That's one of various ways you could design an API for this.

> Properties are introspected via
> org.freedesktop.DBus.Introspectable.Inspect(), which makes sense.

Introspect(), but yes.

> I think this is to-be-implemented.

Yes.

Note that Introspectable is not really intended to be part of anyone's
D-Bus API - it's there to support developer/debugging tools like d-feet
and "gdbus introspect". dbus-python does use it to learn the types of
the arguments of method calls, but that's a historical design flaw[1]
which unfortunately cannot be fixed without breaking its API.

For new code, I would actually recommend using GLib's GDBus via
gobject-introspection, or some other better-designed Python D-Bus API
that has had a chance to learn from dbus-python's mistakes. I don't know
how good <https://pypi.python.org/pypi/txdbus> is, but it might be worth
a look.

    S

[1] "In the face of ambiguity, refuse the temptation to guess"



More information about the dbus mailing list