|
|
2011-02-05
, 23:54
|
|
|
Posts: 46 |
Thanked: 26 times |
Joined on Dec 2007
@ Helsinki
|
#2
|
Was trying to dig up Jabber contacts with a Python script, thought it was going to be just a few lines of code... :P
Here is bit of my code
import evolution adr_book = evolution.ebook.open_addressbook('default') contacts = adr_book.get_all_contacts() icq = [ i.get_property('im-icq') for i in contacts ]According to help( icq[0] ) problem is that property 'im-icq' holds GPointer to list of icq id's. And properties such as 'email-1' hold gchararray, which can be treated by python as string. Also properties such as 'im-icq-home-1',...,'im-icq-work-3' are always None for my contacts.
I am not expert on gtk and its object model, and I couldn't find how I can treat these lists in python. Hermes app just handles contacts as objects, but doesn't access properties such as icq id's.
The only solution, I could find, is getting id's from vcard string via get_vcard_string(), but it seems sooo ugly...
PS just found thread http://talk.maemo.org/showthread.php?t=47840 it seems, that guys decided to parse vcard string and couldn't find better solution, that's sad((