[CalendarServer-changes] [5522] CalendarServer/branches/users/wsanchez/transations/txcaldav/ calendarstore/file.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Apr 22 18:38:10 PDT 2010


Revision: 5522
          http://trac.macosforge.org/projects/calendarserver/changeset/5522
Author:   glyph at apple.com
Date:     2010-04-22 18:38:09 -0700 (Thu, 22 Apr 2010)
Log Message:
-----------
fix a few implementation bugs

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/file.py

Modified: CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/file.py
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/file.py	2010-04-23 01:38:08 UTC (rev 5521)
+++ CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/file.py	2010-04-23 01:38:09 UTC (rev 5522)
@@ -1,3 +1,4 @@
+# -*- test-case-name: txcaldav.calendarstore.test.test_file -*-
 ##
 # Copyright (c) 2010 Apple Inc. All rights reserved.
 #
@@ -87,7 +88,7 @@
         self._operations = []
         self._calendarHomes = {}
 
-    def addOperation(operation):
+    def addOperation(self, operation):
         self._operations.append(operation)
 
     def abort(self):
@@ -146,7 +147,7 @@
         elif not childPath3.isdir():
             return None
 
-        calendarHome = CalendarHome(childPath, self.calendarStore, self)
+        calendarHome = CalendarHome(childPath3, self.calendarStore, self)
         self._calendarHomes[(uid, self)] = calendarHome
         return calendarHome
 
@@ -178,6 +179,8 @@
         calendar = self._newCalendars.get(name)
         if calendar is not None:
             return calendar
+        if name in self._removedCalendars:
+            return None
 
         if name.startswith("."):
             return None
@@ -215,6 +218,7 @@
         if name.startswith(".") or name in self._removedCalendars:
             raise NoSuchCalendarError(name)
 
+        self._removedCalendars.add(name)
         childPath = self.path.child(name)
         if name not in self._newCalendars and not childPath.isdir():
             raise NoSuchCalendarError(name)
@@ -248,7 +252,7 @@
             return undo
 
     def properties(self):
-        raise NotImplementedError()
+        # raise NotImplementedError()
         if not hasattr(self, "_properties"):
             self._properties = PropertyStore(self.path)
         return self._properties
@@ -260,7 +264,7 @@
     def __init__(self, path, calendarHome):
         self.path = path
         self.calendarHome = calendarHome
-        self._transaction = calendarHome.transaction
+        self._transaction = calendarHome._transaction
         self._newCalendarObjects = {}
         self._removedCalendarObjects = set()
 
@@ -293,7 +297,7 @@
             self.calendarObjectWithName(name)
             for name in (
                 set(self._newCalendarObjects.iterkeys()) |
-                set(name in self.path.listdir() if not name.startswith("."))
+                set(name for name in self.path.listdir() if not name.startswith("."))
             )
         )
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100422/26466e89/attachment-0001.html>


More information about the calendarserver-changes mailing list