[CalendarServer-changes] [8912] CalendarServer/trunk/calendarserver/tools/calverify.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 19 12:19:31 PDT 2012


Revision: 8912
          http://trac.macosforge.org/projects/calendarserver/changeset/8912
Author:   cdaboo at apple.com
Date:     2012-03-19 12:19:31 -0700 (Mon, 19 Mar 2012)
Log Message:
-----------
In verbose mode report on organizer components missing a master component.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/calverify.py

Modified: CalendarServer/trunk/calendarserver/tools/calverify.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/calverify.py	2012-03-18 18:39:22 UTC (rev 8911)
+++ CalendarServer/trunk/calendarserver/tools/calverify.py	2012-03-19 19:19:31 UTC (rev 8912)
@@ -625,6 +625,8 @@
             calendar = yield self.getCalendar(resid)
             if calendar is None:
                 continue
+            if self.options["verbose"] and self.masterComponent(calendar) is None:
+                print "Missing master for organizer: %s, resid: %s, uid: %s" % (organizer, resid, uid,)
             organizerViewOfAttendees = self.buildAttendeeStates(calendar, self.start, self.end)
             try:
                 del organizerViewOfAttendees[organizer]
@@ -893,6 +895,18 @@
         returnValue(caldata)
 
 
+    def masterComponent(self, calendar):
+        """
+        Return the master iCal component in this calendar.
+        @return: the L{Component} for the master component,
+            or C{None} if there isn't one.
+        """
+        for component in calendar.getComponents(definitions.cICalComponent_VEVENT):
+            if not component.hasProperty("RECURRENCE-ID"):
+                return component
+        
+        return None
+
     def buildAttendeeStates(self, calendar, start, end, attendee_only=None):
         # Expand events into instances in the start/end range
         results = []
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120319/9c7478c8/attachment.html>


More information about the calendarserver-changes mailing list