PurpleSavedstatusSetSubstatus
Stefan Wennborg
stefan.wennborg at gmail.com
Fri Jul 10 15:34:45 EDT 2009
I want to set a different subsatus for each signed in account.
This is what I got so far...
Code......
#!/usr/bin/env python
import dbus
bus = dbus.SessionBus()
obj = bus.get_object("im.pidgin.purple.PurpleService",
"/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
accs = purple.PurpleAccountsGetAllActive()
for i in range(len(accs)):
print purple.PurpleAccountGetUsername(accs[i])
current =
purple.PurpleSavedstatusGetType(purple.PurpleSavedstatusGetCurrent())
status = purple.PurpleSavedstatusNew("", current)
print current
purple.PurpleSavedstatusSetMessage(status, "hum")
purple.PurpleSavedstatusSetSubstatus(status, accs[i], current,
"woohoo"+str(i)) #Fails here
purple.PurpleSavedstatusActivate(status)
=============
Output.....
user at computer:~$ python Desktop/pidgin_substatus.py
myname at domain.com
2
Traceback (most recent call last):
File "Desktop/pidgin_substatus.py", line 18, in <module>
purple.PurpleSavedstatusSetSubstatus(status, accs[i], current,
"woohoo"+str(i))
File "/var/lib/python-support/python2.6/dbus/proxies.py", line 140, in
__call__
**keywords)
File "/var/lib/python-support/python2.6/dbus/connection.py", line 622, in
call_blocking
message, timeout)
dbus.exceptions.DBusException: im.pidgin.purple.InvalidHandle:
PurpleStatusType object with ID = 2 not found
=============
Why does the code result in an error?
http://developer.pidgin.im/doxygen/dev/html/savedstatuses_8h.html#6e3e33d0908ed603858ec404d1122458
That page says that the third argument in PurpleSavedstatusSetSubstatus
needs to be "PurpleStatusType".
A working example would be great...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/support/attachments/20090710/9e594df1/attachment.htm>
More information about the Support
mailing list