[pygtk] About evolution-python
Adolfo González Blázquez
listas at infinicode.org
Sat Sep 8 02:28:07 WST 2007
Hello,
I am trying to write a little program using the evolution-data-server
python bindings [1], provided by the Conduit project.
What I'm trying to do is to get all contacts from an addresbook, and
display their Name, Email and Birth date, quite simple.
My problem is that the 'birth-date' property returns and EContactDate
(struct {year, month, day}) but I don't know how to access that data.
When i try date.year i get:
AttributeError: 'gobject.GBoxed' object has no attribute 'year'
Any idea on how to deal with this?
Thanks in advance!
-- adolfo
-----------------------------------------
The code is:
#! /usr/bin/env python
# -*- coding: utf8 -*-
from evolution import ebook as eb
book = eb.open_addressbook('default')
contacts = book.get_all_contacts()
for c in contacts:
name = c.get_property('full-name')
email = c.get_property('email-1')
date = c.get_property('birth-date')
print name + ' <' + email +'>'
if date != None:
print date.year, date.month, date.day
-----------------------------------------
[1] http://www.conduit-project.org/wiki/evolution-python
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
digitalmente
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20070907/8833fbfd/attachment.pgp
More information about the pygtk
mailing list