[Telepathy] Problems Setting RequestedPresence

Don Garrett dgarrett at acm.org
Fri Feb 5 14:44:32 PST 2010


  I'm trying to use the Python Dbus bindings to get an account already created in the account manager to connect automatically, and I'm getting an error that I don't understand while trying to set the "RequestedPresence" property on a Gabble Jabber account.

  I can set other properties without trouble, but in this bit of code, the only things I've set have had simple types. The presence value is a struct, but I think I'm doing it right. In both snippets 'account' is a dbus proxy object for the account I'm trying to set values on.

  This works:
            print "ConnectAutomatically", account.object_path
            account.Set('org.freedesktop.Telepathy.Account', 'ConnectAutomatically', True,
                        dbus_interface='org.freedesktop.DBus.Properties',
                        reply_handler=cb.get_callback(),
                        error_handler=util.error_handler_cb)


  This doesn't:
            print "RequestedPresence", account.object_path
            account.Set('org.freedesktop.Telepathy.Account', 'RequestedPresence',
                        dbus.Struct((telepathy.constants.CONNECTION_PRESENCE_TYPE_AVAILABLE, 'available', 'asdf'),
                                    signature='uss'),
                        dbus_interface='org.freedesktop.DBus.Properties',
                        reply_handler=cb.get_callback(),
                        error_handler=util.error_handler_cb)


  It generates:

RequestedPresence /org/freedesktop/Telepathy/Account/gabble/jabber/aldemo1_40pobox_2eagnilux_2ecom1
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 579, in msg_reply_handler
    *message.get_args_list()))
  File "/proj/gazette_dgarrett/sw/client-manager/src/telepathy/util.py", line 9, in error_handler_cb
    raise exception
dbus.exceptions.DBusException: org.freedesktop.Telepathy.Error.InvalidArgument: Unexpected type for RequestedPresence: wanted (u,s,s), got GValueArray_gint+gchararray+gchararray_

-- 
Don



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/telepathy/attachments/20100205/ae19afa3/attachment.html 


More information about the telepathy mailing list