Dictionary argument in Python server method
Alban Crequy
alban.crequy at collabora.co.uk
Thu Sep 17 02:07:08 PDT 2009
Le Wed, 16 Sep 2009 13:15:15 -0700 (PDT),
hkxyz <e11years at gmail.com> a écrit :
>
> hi,
>
> I'm trying to accept a dictionary as an argument to a method as
> follows, however the method fails to be visible. This is with Ubuntu
> jaunty amd64
>
> @dbus.service.method("com.example.poxy", in_signature='a{ss}',
> out_signature='i')
> def test( self, request ):
> pass
>
> Running qdbus shows that the method is 'introspectable', but calling
> it fails with "Cannot find '.test' in object /top at
> com.service.example".
>
> This works with other arguments that are not dictionaries.
Can you run dbus-monitor while you are running your test? So you can
know whether the problem is on the client side (qdbus?) or on the
server side (python-dbus).
python-dbus supports dictionaries and it should work. For example:
http://git.collabora.co.uk/?p=telepathy-mission-control.git;a=blob;f=test/twisted/fakeclient.py;h=d3c438131c6a34ea54ecb1eddea39f8b9b97b67f;hb=HEAD#l85
--
Alban
More information about the dbus
mailing list