Title: [commits] (jeffrey) [15328] - Work around bug 10821, Google iCalendar contains modifications
Revision
15328
Author
jeffrey
Date
2007-09-13 12:55:03 -0700 (Thu, 13 Sep 2007)

Log Message

- Work around bug 10821, Google iCalendar contains modifications
without a master, r=Morgen

Modified Paths

Added Paths

Diff

Modified: trunk/chandler/parcels/osaf/sharing/ics.py (15327 => 15328)

--- trunk/chandler/parcels/osaf/sharing/ics.py	2007-09-12 20:54:51 UTC (rev 15327)
+++ trunk/chandler/parcels/osaf/sharing/ics.py	2007-09-13 19:55:03 UTC (rev 15328)
@@ -496,6 +496,11 @@
                 dtstart      = vobj.getChildValue('dtstart')
                 location     = vobj.getChildValue('location', eim.NoChange)
                 
+                # bug 10821, Google serializes modifications with no master;
+                # treat these as normal events, not modifications
+                if not masters.get(uid):
+                    recurrenceID = None
+                
                 # can't just compare recurrenceID and dtstart, timezone could
                 # have changed, and comparing floating to non-floating would
                 # raise an exception

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

--- trunk/chandler/parcels/osaf/sharing/tests/NoMaster.ics	2007-09-12 20:54:51 UTC (rev 15327)
+++ trunk/chandler/parcels/osaf/sharing/tests/NoMaster.ics	2007-09-13 19:55:03 UTC (rev 15328)
@@ -0,0 +1,14 @@
+BEGIN:VCALENDAR
+VERSION:2.0
+METHOD:PUBLISH
+PRODID:-//PYVOBJECT//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:no_master
+DTSTART:20070619T140000
+RECURRENCE-ID:20070619T000000
+DURATION:PT1H
+DTSTAMP:20070621T190409Z
+STATUS:CONFIRMED
+SUMMARY:A modification with no master
+END:VEVENT
+END:VCALENDAR
Property changes on: trunk/chandler/parcels/osaf/sharing/tests/NoMaster.ics
___________________________________________________________________
Name: svn:eol-style
   + CRLF

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

--- trunk/chandler/parcels/osaf/sharing/tests/TestICalendar.py	2007-09-12 20:54:51 UTC (rev 15327)
+++ trunk/chandler/parcels/osaf/sharing/tests/TestICalendar.py	2007-09-13 19:55:03 UTC (rev 15328)
@@ -75,6 +75,16 @@
         self.assert_(event.effectiveEndTime.replace(tzinfo=None) == endTime)
         self.assert_(event.allDay == True)
 
+    def testNoMaster(self):
+        """
+        Treat a modification without a master as a normal event, because Google
+        exports events like this, bug 10821.
+        """        
+        self.Import(self.view, u'NoMaster.ics')
+        event = pim.EventStamp(sharing.findUID(self.view, 'no_master'))
+        rruleset = getattr(event, 'rruleset', None)
+        self.assertEqual(rruleset, None)
+
     def testSummaryAndDateTimeImported(self):
         self.Import(self.view, u'Chandler.ics')
         event = pim.EventStamp(sharing.findUID(




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

Reply via email to