What you need: Evolution, pygobject, evolution-python, Python (2.4 or higher) and some contacts in your contact list
#!/usr/bin/python
import evolution
import gobject
book = evolution.open_addressbook('default')
props = gobject.list_properties( evolution.EContact)
pp = [ p.name for p in props if 'phone' in p.name ]
for contact in book.get_all_contacts():
gp = contact.get_property
name = gp('file-as')
numbers = ', '.join( [ gp(p) for p in pp if gp(p) ])
if numbers:
print ': '.join( [ name, numbers ])
2 comments:
Nice guide, thanks a lot....
but I'm going crazy to get data from GParamBoxed data like 'birth-date'
could you add some stuff like this to source code?
I'm now using an improved version of this code in smpy, which can be found here: http://thpinfo.com/2007/hacks/#smpy
Post a Comment