From: Jelmer Vernooij <[email protected]>
See RFC5545, section 3.6.1.
---
calypso/webdav.py | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/calypso/webdav.py b/calypso/webdav.py
index f6b84ab..0acfdf0 100644
--- a/calypso/webdav.py
+++ b/calypso/webdav.py
@@ -58,6 +58,14 @@ def find_vobject_value(vobject, name):
return value
return None
+
+def sanitize_vevent(ve):
+ # Check for events with both dtend and duration entries and
+ # delete the duration one
+ if ve.contents.has_key('dtend') and ve.contents.has_key('duration'):
+ del ve.contents['duration']
+
+
class Item(object):
"""Internal item. Wraps a vObject"""
@@ -514,10 +522,7 @@ class Collection(object):
events = new_ics.vevent_list
for ve in events:
- # Check for events with both dtstart and duration
entries and
- # delete the duration one
- if ve.contents.has_key('dtstart') and
ve.contents.has_key('duration'):
- del ve.contents['duration']
+ sanitize_vevent(ve)
new_ics.vevent_list = [ve]
new_item = Item(new_ics.serialize().decode('utf-8'),
None, path)
self.import_item(new_item, path)
@@ -528,7 +533,7 @@ class Collection(object):
except Exception, ex:
self.log.exception("Failed to import: %s", path)
return False
-
+
def write(self, headers=None, items=None):
return True
--
2.7.0
_______________________________________________
Calypso mailing list
[email protected]
http://keithp.com/mailman/listinfo/calypso