Out-of-the-box simple configuration

git-svn-id: http://svn.32rwr.info/radicale/trunk@5 74e4794c-479d-4a33-9dda-c6c359d70f12
This commit is contained in:
(no author)
2008-12-30 19:26:03 +00:00
parent 5e1a4d4131
commit e87d37703d
7 changed files with 72 additions and 13 deletions

View File

@ -21,18 +21,21 @@
import calendar
def writeCalendar(headers=[], timezones=[], todos=[], events=[]):
def writeCalendar(headers=[calendar.Header("PRODID:-//The Radicale Team//NONSGML Radicale Server//EN"),
calendar.Header("VERSION:2.0")],
timezones=[], todos=[], events=[]):
"""
Create calendar from headers, timezones, todos, events
"""
# TODO: Manage encoding and EOL
return "\n".join((
cal = "\n".join((
"BEGIN:VCALENDAR",
"\n".join([header.text for header in headers]),
"\n".join([timezone.text for timezone in timezones]),
"\n".join([todo.text for todo in todos]),
"\n".join([event.text for event in events]),
"END:VCALENDAR"))
return "\n".join([line for line in cal.splitlines() if line])
def events(vcalendar):
"""