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

Attachment: signature.asc
Description: Esta parte del mensaje está firmada digitalmente

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to