Title: [commits] (jeffrey) [15329] - Handle RDATE only recurring events, bug 10815, r=morgen
Revision
15329
Author
jeffrey
Date
2007-09-13 13:00:03 -0700 (Thu, 13 Sep 2007)

Log Message

- Handle RDATE only recurring events, bug 10815, r=morgen

Modified Paths

Added Paths

Diff

Modified: trunk/chandler/parcels/osaf/sharing/tests/TestICalendar.py (15328 => 15329)

--- trunk/chandler/parcels/osaf/sharing/tests/TestICalendar.py	2007-09-13 19:55:03 UTC (rev 15328)
+++ trunk/chandler/parcels/osaf/sharing/tests/TestICalendar.py	2007-09-13 20:00:03 UTC (rev 15329)
@@ -110,6 +110,12 @@
          "allDay not set properly for all day event, allDay is %s"
          % event.allDay)
 
+    def testRDateOnly(self):
+        self.Import(self.view, u'rdates.ics')
+        event = pim.EventStamp(sharing.findUID(self.view, 'rdate_test'))
+        self.failUnless(pim.has_stamp(event, pim.EventStamp))
+        self.assertEqual(len(event.rruleset.rdates), 3)
+
     def testDateValuedExDate(self):
         self.Import(self.view, u'AllDayRecurrence.ics')
         event = pim.EventStamp(sharing.findUID(self.view, 'testAllDay'))

Added: trunk/chandler/parcels/osaf/sharing/tests/rdates.ics (15328 => 15329)

--- trunk/chandler/parcels/osaf/sharing/tests/rdates.ics	2007-09-13 19:55:03 UTC (rev 15328)
+++ trunk/chandler/parcels/osaf/sharing/tests/rdates.ics	2007-09-13 20:00:03 UTC (rev 15329)
@@ -0,0 +1,47 @@
+BEGIN:VCALENDAR
+VERSION:2.0
+X-WR-CALNAME:Work
+PRODID:-//Apple Computer\, Inc//iCal 1.5//EN
+X-WR-TIMEZONE:US/Central
+CALSCALE:GREGORIAN
+METHOD:PUBLISH
+BEGIN:VTIMEZONE
+TZID:US/Pacific
+LAST-MODIFIED:20050802T185143Z
+BEGIN:DAYLIGHT
+DTSTART:20050403T100000
+TZOFFSETTO:-0700
+TZOFFSETFROM:+0000
+TZNAME:PDT
+END:DAYLIGHT
+BEGIN:STANDARD
+DTSTART:20051030T020000
+TZOFFSETTO:-0800
+TZOFFSETFROM:-0700
+TZNAME:PST
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VTIMEZONE
+TZID:US/Central
+LAST-MODIFIED:20050801T155034Z
+BEGIN:DAYLIGHT
+DTSTART:20050403T080000
+TZOFFSETTO:-0500
+TZOFFSETFROM:+0000
+TZNAME:CDT
+END:DAYLIGHT
+BEGIN:STANDARD
+DTSTART:20051030T020000
+TZOFFSETTO:-0600
+TZOFFSETFROM:-0500
+TZNAME:CST
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+DTSTART;TZID=US/Central:20050810T110000
+SUMMARY:Test RDATEs
+UID:rdate_test
+RDATE;TZID=US/Central:20050817T110000,20050818T110000,20050819T110000
+DURATION:PT1H
+END:VEVENT
+END:VCALENDAR
Property changes on: trunk/chandler/parcels/osaf/sharing/tests/rdates.ics
___________________________________________________________________
Name: svn:eol-style
   + CRLF

Modified: trunk/chandler/parcels/osaf/sharing/translator.py (15328 => 15329)

--- trunk/chandler/parcels/osaf/sharing/translator.py	2007-09-13 19:55:03 UTC (rev 15328)
+++ trunk/chandler/parcels/osaf/sharing/translator.py	2007-09-13 20:00:03 UTC (rev 15329)
@@ -1430,7 +1430,8 @@
                             
                     setattr(rruleset, datetype + 's', dates)
 
-            if len(rruleset.rrules) == 0 and len(rruleset.rdates) == 0:
+            if (len(getattr(rruleset, 'rrules', ())) == 0 and
+                len(getattr(rruleset, 'rdates', ())) == 0):
                 event.removeRecurrence()
             else:
                 # if the master is in the past but not triaged DONE before




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to