[Vobject] Recurrence

Jeffrey Harris jeffrey at osafoundation.org
Wed Mar 14 11:56:31 CDT 2007


Hi Teemu,
> I'm new to the list and writing a small app to retrieve and show calendar 
> entries stored on an IMAP server. I must admit I'm a novice developer, 
> especially in Python and iCalendar, so you may have to put up with generic 
> Python and/or stupid questions from me.

On an IMAP server, huh?  So do you have iCalendar attachments to emails
stored in IMAP, or just straight iCalendar?

> The first question is how to test if an entry is a recurring one or not?

The short answer is to test if a vevent's magic rruleset attribute is None.

For example, if stream is an icalendar stream:

>>> import vobject
>>> cal = vobject.readOne(stream)
>>> events = cal.vevent_list
>>> recurring_events = [ev for ev in events if ev.rruleset is not None]

Sincerely,
Jeffrey


More information about the VObject mailing list