Signatures For Nested Dictionaries and List of Dictionaries

Mystilleef mystilleef at gmail.com
Sat Feb 25 15:39:17 PST 2012


I'm at my wits end and I need your help.

I'm trying to convert a Python Dictionary into a DBus
Dictionary to stop DBus from whining.

I've tried every possible signature I could come up with
in the last 12 hours and still no dice. I get the following
error or similar.

============================================================
ERROR:dbus.service:Unable to guess signature for arguments
(dbus.Dictionary({u'results': {u'albums': [], u'songs': [{u'comment':
u'', u'rating': 5, u'lastPlayed': 1329804001860872L, u'disc': 0,
u'composer': u'', u'year': 2011, u'id':
u'4c2aa2f4-44cd-37ad-8327-b14de16d492e', u'album': u'', u'title':
u'Neverland', u'track': 1, u'albumArtist': u'J Cole', u'type': 2,
u'titleNorm': u'neverland', u'deleted': False, u'albumArtistNorm': u'j
cole', u'totalTracks': 0, u'beatsPerMinute': 0, u'genre': u'',
u'playCount': 14, u'creationDate': 1318054682121584L, u'name':
u'Neverland', u'albumNorm': u'', u'artist': u'J Cole', u'url': u'',
u'totalDiscs': 0, u'durationMillis': 223000, u'artistNorm': u'j
cole'}], u'artists': []}}, signature=None),): <type
'exceptions.ValueError'>: Unable to guess signature from an empty list
org.freedesktop.DBus.Python.ValueError: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dbus/service.py", line 745,
in _message_cb
    _method_reply_return(connection, message, method_name, signature, *retval)
  File "/usr/lib/python2.7/site-packages/dbus/service.py", line 257,
in _method_reply_return
    signature = reply.guess_signature(retval) + ' (guessed)'
ValueError: Unable to guess signature from an empty list
============================================================

I've attempted the following:

	dbus.Dictionary(dictionary, signature="sv")
	dbus.Dictionary(dictionary, signature="(sv)")
	dbus.Dictionary(dictionary, signature="sa{sv}")
	dbus.Dictionary(dictionary, signature="sa{sa(sv)}")
	dbus.Dictionary(dictionary, signature="sa{sa{sv}}")

and so on to no avail. I've attempted all variant_levels and
failed again. I've read the docs, tried to find sources with
complicated signatures and ransacked the Interwebz. Still
nothin. I'm just not smart enough to figure it out myself.
So I need your help, any help is appreciated.

Thanks

Lateef


More information about the dbus mailing list