parameter matching in python (client side)

Vincent Génieux vincent.genieux at
Thu Oct 18 06:23:52 PDT 2007


I am using the dbus proxy, in a client to make method calls on a dbus 
service (written in python):

remote = bus.get_object("com.example.Sample",

My dbus service contains a method "func3" with 3 parameters:
  <interface name="com.example.Sample">
    <method name="func3">
      <arg direction="in"  type="s" name="param1" />
      <arg direction="in"  type="i" name="param2" />
      <arg direction="in"  type="s" name="param3" />

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")

But this raise the following exception:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/lib/python-support/python2.5/dbus/", line 169, in 
    reply_message = 
self._connection.send_message_with_reply_and_block(message, timeout)
dbus.DBusException: org.freedesktop.DBus.Python.TypeError: Traceback 
(most recent call last):
  File "/var/lib/python-support/python2.5/dbus/", line 451, in 
    retval = candidate_method(self, *args, **keywords)
TypeError: func3() takes exactly 4 arguments (1 given)

So what is the good way to proceed ? my python-dbus version is (0, 80, 2)

Vincent Genieux.

More information about the dbus mailing list