This code may be useful to you if you need to export your events as
ics so that they can be imported by iCal and Google Calendar.
def ics(title,events)
import datetime
s = 'BEGIN:VCALENDAR'
s += '\nVERSION:2.0'
s += '\nX-WR-CALNAME:%s' % title
s += '\nSUMMARY:%s' % title
s += '\nPRODID:-//Generated by RSScal//web2py 2011'
s += '\nCALSCALE:GREGORIAN'
s += '\nMETHOD:PUBLISH'
format = '%Y%m%dT%H%M%SZ'
for item in events:
s += '\nBEGIN:VEVENT'
s += '\nUID:%s' % item['link']
s += '\nURL:%s' % item['link']
s += '\nDTSTART:%s' % item['start'].strftime(format)
s += '\nDTEND:%s' % item['stop'].strftime(format)
s += '\nSUMMARY:%s' % item['title']
s += '\nEND:VEVENT'
s += '\nEND:VCALENDAR'
return s
here title is the title of your calendar and events is a list of
dict(title=...,start=..,stop=...,link=...)
start and stop are datetime.datetime objects.
it returns the and ics presentation of the events.