O Evolution Data Server 3.6 pode ser acessado com o Python usando a introspecção de objetos. Para isso, gir1.2-edataserver-1.2
e gir1-2-ecalendar-1.2
também precisam ser instalados.
Por exemplo, o seguinte script listará todos os eventos em todos os calendários em evolution-data-server.
#! /usr/bin/python
# -*- coding: utf-8 -*-
from gi.repository import ECalendar
from gi.repository import EDataServer
# Open a registry and get a list of all the calendars in EDS
registry = EDataServer.SourceRegistry.new_sync(None)
sources = EDataServer.SourceRegistry.list_sources(registry, EDataServer.SOURCE_EXTENSION_CALENDAR)
# Open each calendar containing events and get a list of all objects in them
for source in sources:
client = ECalendar.CalClient.new(source, ECalendar.CalSourceType.EVENT)
client.open_sync(False, None)
# ret is true or false depending if events are found or not
# values is a list of events
ret, values = client.get_object_list_as_comps_sync("#t", None)
if ret:
for value in values:
event = value.get_as_string()
print event