From 54aa8817e79ee25589e71baca19cce42c4905f45 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 25 Jan 2012 14:40:00 +0100 Subject: [PATCH] Add the "set_mimetype" method forgotten during the merge (closes #657) --- radicale/ical.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/radicale/ical.py b/radicale/ical.py index aca1becd..e33f0ace 100644 --- a/radicale/ical.py +++ b/radicale/ical.py @@ -362,6 +362,15 @@ class Collection(object): text = serialize(headers, items) self.save(text) + def set_mimetype(self, mimetype): + """Set the mimetype of the collection.""" + with self.props as props: + if "tag" not in props: + if mimetype == "text/vcard": + props["tag"] = "VADDRESSBOOK" + else: + props["tag"] = "VCALENDAR" + @property def tag(self): """Type of the collection."""