[CalendarServer-changes] [4988] CalendarServer/trunk/txcaldav/icalendarstore.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 29 16:02:04 PST 2010


Revision: 4988
          http://trac.macosforge.org/projects/calendarserver/changeset/4988
Author:   wsanchez at apple.com
Date:     2010-01-29 16:02:04 -0800 (Fri, 29 Jan 2010)
Log Message:
-----------
No self.
Add some more exceptions.
Add exceptions to __all__.

Modified Paths:
--------------
    CalendarServer/trunk/txcaldav/icalendarstore.py

Modified: CalendarServer/trunk/txcaldav/icalendarstore.py
===================================================================
--- CalendarServer/trunk/txcaldav/icalendarstore.py	2010-01-29 20:28:14 UTC (rev 4987)
+++ CalendarServer/trunk/txcaldav/icalendarstore.py	2010-01-30 00:02:04 UTC (rev 4988)
@@ -19,6 +19,21 @@
 """
 
 __all__ = [
+    # Exceptions
+    "CalendarStoreError",
+    "NameNotAllowedError",
+    "CalendarNameNotAllowedError",
+    "CalendarObjectNameNotAllowedError",
+    "AlreadyExistsError",
+    "CalendarAlreadyExistsError",
+    "CalendarObjectNameAlreadyExistsError",
+    "CalendarObjectUIDAlreadyExistsError",
+    "NotFoundError",
+    "NoSuchCalendarError",
+    "NoSuchCalendarObjectError",
+    "InvalidCalendarComponentError",
+
+    # Classes
     "ICalendarHome",
     "ICalendar",
     "ICalendarObject",
@@ -27,7 +42,7 @@
 from zope.interface import Interface #, Attribute
 
 from datetime import datetime, date, tzinfo
-from twext.icalendar import Component
+from twext.python.icalendar import Component
 from txdav.idav import IPropertyStore
 
 #
@@ -39,6 +54,21 @@
     Calendar store generic error.
     """
 
+class NameNotAllowedError(CalendarStoreError):
+    """
+    Attempt to create an object with a name that is not allowed.
+    """
+
+class CalendarNameNotAllowedError(NameNotAllowedError):
+    """
+    Calendar name not allowed.
+    """
+
+class CalendarObjectNameNotAllowedError(NameNotAllowedError):
+    """
+    Calendar object name not allowed.
+    """
+
 class AlreadyExistsError(CalendarStoreError):
     """
     Attempt to create an object that already exists.
@@ -87,14 +117,21 @@
     """
     Calendar home
     """
-    def calendars(self):
+    def uid():
         """
+        Retrieve the unique identifier for this calendar home.
+
+        @return: a string.
+        """
+
+    def calendars():
+        """
         Retrieve calendars contained in this calendar home.
 
         @return: an iterable of L{ICalendar}s.
         """
 
-    def calendarWithName(self, name):
+    def calendarWithName(name):
         """
         Retrieve the calendar with the given C{name} contained in this
         calendar home.
@@ -104,7 +141,7 @@
             exists.
         """
 
-    def createCalendarWithName(self, name):
+    def createCalendarWithName(name):
         """
         Create a calendar with the given C{name} in this calendar
         home.
@@ -114,7 +151,7 @@
             given C{name} already exists.
         """
 
-    def removeCalendarWithName(self, name):
+    def removeCalendarWithName(name):
         """
         Remove the calendar with the given C{name} from this calendar
         home.  If this calendar home owns the calendar, also remove
@@ -124,7 +161,7 @@
         @raise NoSuchCalendarObjectError: if no such calendar exists.
         """
 
-    def properties(self):
+    def properties():
         """
         Retrieve the property store for this calendar home.
 
@@ -135,7 +172,7 @@
     """
     Calendar
     """
-    def ownerCalendarHome(self):
+    def ownerCalendarHome():
         """
         Retrieve the calendar home for the owner of this calendar.
         Calendars may be shared from one (the owner's) calendar home
@@ -144,14 +181,14 @@
         @return: an L{ICalendarHome}.
         """
 
-    def calendarObjects(self):
+    def calendarObjects():
         """
         Retrieve the calendar objects contained in this calendar.
 
         @return: an iterable of L{ICalendarObject}s.
         """
 
-    def calendarObjectWithName(self, name):
+    def calendarObjectWithName(name):
         """
         Retrieve the calendar object with the given C{name} contained
         in this calendar.
@@ -161,7 +198,7 @@
             object exists.
         """
 
-    def calendarObjectWithUID(self, uid):
+    def calendarObjectWithUID(uid):
         """
         Retrieve the calendar object with the given C{uid} contained
         in this calendar.
@@ -171,7 +208,7 @@
             object exists.
         """
 
-    def createCalendarObjectWithName(self, name, component):
+    def createCalendarObjectWithName(name, component):
         """
         Create a calendar component with the given C{name} in this
         calendar from the given C{component}.
@@ -188,7 +225,7 @@
             a calendar object.
         """
 
-    def removeCalendarComponentWithName(self, name):
+    def removeCalendarComponentWithName(name):
         """
         Remove the calendar component with the given C{name} from this
         calendar.
@@ -198,7 +235,7 @@
             exists.
         """
 
-    def removeCalendarComponentWithUID(self, uid):
+    def removeCalendarComponentWithUID(uid):
         """
         Remove the calendar component with the given C{uid} from this
         calendar.
@@ -208,14 +245,14 @@
             not exist.
         """
 
-    def syncToken(self):
+    def syncToken():
         """
         Retrieve the current sync token for this calendar.
 
         @return: a string containing a sync token.
         """
 
-    def calendarObjectsInTimeRange(self, start, end, timeZone):
+    def calendarObjectsInTimeRange(start, end, timeZone):
         """
         Retrieve all calendar objects in this calendar which have
         instances that occur within the time range that begins at
@@ -227,7 +264,7 @@
         @return: an iterable of L{ICalendarObject}s.
         """
 
-    def calendarObjectsSinceToken(self, token):
+    def calendarObjectsSinceToken(token):
         """
         Retrieve all calendar objects in this calendar that have
         changed since the given C{token} was last valid.
@@ -238,7 +275,7 @@
             that have been removed, and the current sync token.
         """
 
-    def properties(self):
+    def properties():
         """
         Retrieve the property store for this calendar.
 
@@ -249,7 +286,7 @@
     """
     Calendar object (event, to-do, etc.).
     """
-    def setComponent(self, component):
+    def setComponent(component):
         """
         Rewrite this calendar object to match the given C{component}.
         C{component} must have the same UID and be of the same
@@ -261,14 +298,14 @@
             a calendar object.
         """
 
-    def component(self):
+    def component():
         """
         Retrieve the calendar component for this calendar object.
 
         @return: a C{VCALENDAR} L{Component}.
         """
 
-    def iCalendarText(self):
+    def iCalendarText():
         """
         Retrieve the iCalendar text data for this calendar object.
 
@@ -276,14 +313,14 @@
             calendar object.
         """
 
-    def uid(self):
+    def uid():
         """
         Retrieve the UID for this calendar object.
 
         @return: a string containing a UID.
         """
 
-    def componentType(self):
+    def componentType():
         """
         Retrieve the iCalendar component type for the main component
         in this calendar object.
@@ -291,7 +328,7 @@
         @return: a string containing the component type.
         """
 
-    def organizer(self):
+    def organizer():
         # FIXME: Ideally should return a URI object
         """
         Retrieve the organizer's calendar user address for this
@@ -300,7 +337,7 @@
         @return: a URI string.
         """
 
-    def properties(self):
+    def properties():
         """
         Retrieve the property store for this calendar object.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100129/59962c38/attachment-0001.html>


More information about the calendarserver-changes mailing list