[Kolab-devel] python connector - preliminary ideas

Stéphane Konstantaropoulos skonstant at sgul.ac.uk
Fri Dec 1 15:05:41 CET 2006


Hi All,

This is more loud talk than actual design.

Python has the imaplib library that allow to access almost all the features of 
IMAP4rev1. However it does not have any object oriented way of directly 
accessing messages.

A little problem there is that the annotations are supported only from Python 
2.5, we could check for the version and if it's an older version we are 
running we could just use the standard names ("Calendar", "Contacts", "Tasks" 
and "Journal").

I think the easiest API to propose is an object oriented one with classes such 
as:

Kolab -> extended IMAP4 class with methods:
getDefaulCalendar, getCalendars, getCalendar(name)
... for Mail, Tasks, Journal and Contacts.

Calendar:
getEvents([from], [to])

Event:
all the attributes related to events

AddressBook:
getContact("name"), getContacts()...

Contact:
all the attributes related to contacts

We need to agree on naming (Calendar -> Event, AddressBook -> Contact, 
TaskList??, Journal??)

As for the attributes, we can use those that are supported in the XML 
specification.

All the IMAP cooking would be hidden by that API.

We could have write and delete methods too?

How do you want to split the code? all in one file or split between smaller 
files: kolab.py or kolab/Kolab.py kolab/Calendar.py...

Just giving ideas now, let me know what you think.

-- 
Stéphane Konstantaropoulos <skonstant at sgul.ac.uk>
-- Web Developer - Computing Services
--- St George's University of London
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1355 bytes
Desc: not available
URL: <http://lists.kolab.org/pipermail/devel/attachments/20061201/89031214/attachment.p7s>


More information about the devel mailing list