[Commits] (jeffrey) - temporary work around for bug that Morgen noticed where recurring events whose DTSTART is a DATE not a DATE-TIME make import fail. Recurrence information for these items is just ignored for now.

commits at osafoundation.org commits at osafoundation.org
Sat Feb 12 15:40:42 PST 2005


Commit by: jeffrey
Modified files:
chandler/parcels/osaf/framework/sharing/ICalendar.py 1.12 1.13

Log message:
- temporary work around for bug that Morgen noticed where recurring events whose DTSTART is a DATE not a DATE-TIME make import fail.  Recurrence information for these items is just ignored for now.

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/ICalendar.py.diff?r1=text&tr1=1.12&r2=text&tr2=1.13

Index: chandler/parcels/osaf/framework/sharing/ICalendar.py
diff -u chandler/parcels/osaf/framework/sharing/ICalendar.py:1.12 chandler/parcels/osaf/framework/sharing/ICalendar.py:1.13
--- chandler/parcels/osaf/framework/sharing/ICalendar.py:1.12	Wed Feb  9 12:36:53 2005
+++ chandler/parcels/osaf/framework/sharing/ICalendar.py	Sat Feb 12 15:40:40 2005
@@ -236,7 +236,16 @@
             uidMatchItem = self.findUID(event.uid[0].value)
             first = True
             
-            for dt in itertools.islice(event.rruleset, MAXRECUR):
+            # FIXME total hack to deal with the fact that dateutil.rrule doesn't
+            # know how to deal with dates without time.
+            # If DTSTART's VALUE parameter is set to DATE, don't use rruleset
+            isDate = type(event.dtstart[0].value) == datetime.date
+            if isDate:
+                recurrenceIter = [event.dtstart[0].value]
+            else:
+                recurrenceIter = itertools.islice(event.rruleset, MAXRECUR)
+            
+            for dt in recurrenceIter:
                 if uidMatchItem is not None:
                     logger.debug("matched UID")
                     eventItem = uidMatchItem



More information about the Commits mailing list