Python non-variant is passed as an argument

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Mar 25 09:02:35 PDT 2010


On Thu, 25 Mar 2010 at 15:16:37 +0000, Arigead wrote:
> in the documentation [1]. Is this documentation correct? I'd assumed
> that the python DBus would be doing introspection.

It does, unless you specifically ask it not to. Does navit reply correctly
to the Introspect() method?

(If not, then the best dbus-python can possibly do is to guess, from the
arguments you've given it, what types the method is meant to receive -
if its guesses are wrong then you'll have to either work around that
deficiency in navit, or get it fixed.)

> I'll go and try to
> work out how you cast the 'o' object into a variant in Python.

Like so:

    navit.SomeMethod("callback", dbus.ObjectPath(my_o_object, variant_level=1))

Or, override the introspected/guessed signature with what you know it to be,
and dbus-python will do the right thing:

    navit.SomeMethod("callback", my_o_object, signature='sv')

    S


More information about the dbus mailing list