about object introspection for dbus
Simon McVittie
simon.mcvittie at collabora.co.uk
Thu May 21 02:59:42 PDT 2009
On Thu, 21 May 2009 at 12:46:10 +0300, Ville M. Vainio wrote:
> Intrerestingly, python-dbus binding also seems to work with a trivial
> introspection (i.e. the introspection xml doesn't really need to
> contain any of the methods you provide, as long as you reply to
> "Introspect()" method call).
In the absence of useful results from Introspect(), dbus-python is forced to
make arbitrary guesses (based on the Python types) about the D-Bus types the
Python programmer intended to use. These guesses are likely to be wrong in
many (most?) cases.
The dbus-python tutorial and API documentation contain the exact type mappings
that it will use when guessing.
So, correct introspection results are strongly recommended.
On the bright side, writing introspection XML is not rocket science :-) In most
applications that use libdbus directly, it would probably be reasonable to
hard-code a large C string constant per object, containing pre-written
introspection XML.
Simon
More information about the dbus
mailing list