Revision
846
Author
wsanchez@apple.com
Date
2006-12-15 20:21:40 -0800 (Fri, 15 Dec 2006)

Log Message

Make all implementations of provisionChild() take a name argument.

Modified Paths

Diff

Modified: CalendarServer/trunk/twistedcaldav/directory/calendar.py (845 => 846)


--- CalendarServer/trunk/twistedcaldav/directory/calendar.py	2006-12-16 03:48:58 UTC (rev 845)
+++ CalendarServer/trunk/twistedcaldav/directory/calendar.py	2006-12-16 04:21:40 UTC (rev 846)
@@ -26,7 +26,6 @@
     "DirectoryCalendarHomeResource",
 ]
 
-from twisted.internet.defer import succeed
 from twisted.web2.dav import davxml
 from twisted.web2.dav.util import joinURL
 from twisted.web2.dav.resource import TwistedACLInheritable, TwistedQuotaRootProperty
@@ -138,7 +137,7 @@
             assert name is None
             name = record.shortName
 
-        return self.provisionChild(record)
+        return self.provisionChild(name)
 
     def listChildren(self):
         return (record.shortName for record in self.directory.listRecords(self.recordType))

Modified: CalendarServer/trunk/twistedcaldav/static.py (845 => 846)


--- CalendarServer/trunk/twistedcaldav/static.py	2006-12-16 03:48:58 UTC (rev 845)
+++ CalendarServer/trunk/twistedcaldav/static.py	2006-12-16 04:21:40 UTC (rev 846)
@@ -400,8 +400,8 @@
         DAVFile.__init__(self, path)
         DirectoryCalendarHomeProvisioningResource.__init__(self, directory, url)
 
-    def provisionChild(self, recordType):
-        return CalendarHomeTypeProvisioningFile(self.fp.child(recordType).path, self, recordType)
+    def provisionChild(self, name):
+        return CalendarHomeTypeProvisioningFile(self.fp.child(name).path, self, name)
 
     def createSimilarFile(self, path):
         raise HTTPError(responsecode.NOT_FOUND)
@@ -420,8 +420,8 @@
         DAVFile.__init__(self, path)
         DirectoryCalendarHomeTypeProvisioningResource.__init__(self, parent, recordType)
 
-    def provisionChild(self, record):
-        child = CalendarHomeFile(self.fp.child(record.shortName).path, self, record)
+    def provisionChild(self, name):
+        child = CalendarHomeFile(self.fp.child(name).path, self, self.directory.recordWithShortName(self.recordType, name))
         if not child.exists():
             return child.provisionDefaultCalendars()
         return child