parameter matching in python (client side)

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Oct 18 07:14:37 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 18 Oct 2007 at 15:23:52 +0200, Vincent Génieux wrote:
> I would like to make name my parameters when calling the remote 
> function, I a trying to do this:
> remote.func3(param1="myStr1", param2=2, param3="myStr3")

You can't. D-Bus only supports positional parameters.

If you want a "named parameters" style on D-Bus, you'd have to use a dict.
Specifications often use "a{sv}" or "a{ss}" for extensible named
parameters - for instance, freedesktop.org notifications
(http://www.galago-project.org/specs/notification/0.9/x408.html#command-notify)
use an a{sv} for the "hints" parameter.

D-Bus also doesn't support optional parameters, so naming the parameters
in Python isn't very useful.

	Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFHF2pNWSc8zVUw7HYRAim/AKC9yFKDQFwMgDmuWwXmzOJeV1qCGwCfX8Ws
f5g3YLIcQlrl7ztjqsIVJ+k=
=0wmI
-----END PGP SIGNATURE-----


More information about the dbus mailing list