Add the "set_mimetype" method forgotten during the merge (closes #657)
This commit is contained in:
parent
42ba9e0dca
commit
54aa8817e7
@ -362,6 +362,15 @@ class Collection(object):
|
|||||||
text = serialize(headers, items)
|
text = serialize(headers, items)
|
||||||
self.save(text)
|
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
|
@property
|
||||||
def tag(self):
|
def tag(self):
|
||||||
"""Type of the collection."""
|
"""Type of the collection."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user