signatures

John (J5) Palmieri johnp at redhat.com
Mon Aug 27 11:49:36 PDT 2007


On Mon, 2007-08-27 at 14:17 -0400, John (J5) Palmieri wrote:
> On Sun, 2007-08-26 at 23:06 +0200, Yann Leboulanger wrote:
> > Hi all,
> > 
> > We have a problem in our project with signatres, and as I'm not an
> > expert in Dbus, I prefer to ask here.
> > 
> > Here is our python code :
> > 
> >    @dbus.service.method(INTERFACE, in_signature='s', out_signature='av')
> >    def list_contacts(self, account):
> >       result = dbus.Array([], signature='a{sv}')
> >       # Here we fill the array
> >       return result
> > 
> > out_signature for the func in 'av' and signature of the result var is a{sv}.
> > 
> > Should the out_signature be a{sv} too ?
> > 
> > thanks for your help
> 
> Yes, signatures must be exact.

I should note that variants are separate types.  Though they can hold
any type they are not wild cards.   If an application is looking for a
variant but gets a dict_entry instead it is a type mismatch and an error
is thrown.

-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list