parameter matching in python (client side)

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


Hi,

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",
                        "/com/example/Sample",
                        follow_name_owner_changes=True)


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" />
    </method>
...
  </inferface>


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/proxies.py", line 169, in 
__call__
    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/service.py", line 451, in 
_message_cb
    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