[CalendarServer-changes] [6015] CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore /postgres.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Aug 9 11:06:45 PDT 2010


Revision: 6015
          http://trac.macosforge.org/projects/calendarserver/changeset/6015
Author:   glyph at apple.com
Date:     2010-08-09 11:06:44 -0700 (Mon, 09 Aug 2010)
Log Message:
-----------
more stub implementation

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py

Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py	2010-08-09 18:06:13 UTC (rev 6014)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py	2010-08-09 18:06:44 UTC (rev 6015)
@@ -499,7 +499,6 @@
 
 
 
-
 class PostgresLegacySharesEmulator(object):
 
     def __init__(self, home):
@@ -582,6 +581,32 @@
         self.calendar = calendar
 
 
+    def reserveUID(self, uid):
+        pass
+
+
+    def isAllowedUID(self, uid, *names):
+        """
+        @see: L{twistedcaldav.index.Index.isAllowedUID}
+        """
+        return True
+
+
+    def resourceNameForUID(self, uid):
+        obj = self.calendar.calendarObjectWithUID(uid)
+        if obj is None:
+            return None
+        return obj.name()
+
+
+    def unreserveUID(self, uid):
+        pass
+
+
+    def indexedSearch(self, filter, userid='', fbtype=False):
+        return []
+
+
 class PostgresCalendar(object):
 
     implements(ICalendar)
@@ -811,12 +836,14 @@
         return self.uid()
 
 
-    def calendars(self):
+    def listChildren(self):
         """
-        Retrieve calendars contained in this calendar home.
+        Retrieve the names of the children in this calendar home.
 
-        @return: an iterable of L{ICalendar}s.
+        @return: an iterable of C{str}s.
         """
+        # FIXME: not specified on the interface or exercised by the tests, but
+        # required by clients of the implementation!
         rows = self._txn.execSQL(
             "select CALENDAR_RESOURCE_NAME from CALENDAR_BIND where "
             "CALENDAR_HOME_RESOURCE_ID = %s "
@@ -824,6 +851,16 @@
             [self._resourceID, _BIND_STATUS_DECLINED]
         )
         names = [row[0] for row in rows]
+        return names
+
+
+    def calendars(self):
+        """
+        Retrieve calendars contained in this calendar home.
+
+        @return: an iterable of L{ICalendar}s.
+        """
+        names = self.listChildren()
         for name in names:
             yield self.calendarWithName(name)
 
@@ -912,7 +949,7 @@
         return PropertyStore(
             self.uid(),
             self.uid(),
-            self._txn._cursor,
+            self._txn,
             self._resourceID
         )
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100809/ea94f5cb/attachment-0001.html>


More information about the calendarserver-changes mailing list