[CalendarServer-changes] [2276] CalendarServer/branches/release/CalendarServer-1.3-dev/twistedcaldav /static.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 2 15:16:05 PDT 2008


Revision: 2276
          http://trac.macosforge.org/projects/calendarserver/changeset/2276
Author:   wsanchez at apple.com
Date:     2008-04-02 15:16:04 -0700 (Wed, 02 Apr 2008)

Log Message:
-----------
Make calendar home resource class modular.

Modified Paths:
--------------
    CalendarServer/branches/release/CalendarServer-1.3-dev/twistedcaldav/static.py

Modified: CalendarServer/branches/release/CalendarServer-1.3-dev/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-1.3-dev/twistedcaldav/static.py	2008-04-02 17:32:41 UTC (rev 2275)
+++ CalendarServer/branches/release/CalendarServer-1.3-dev/twistedcaldav/static.py	2008-04-02 22:16:04 UTC (rev 2276)
@@ -469,12 +469,16 @@
         DirectoryCalendarHomeTypeProvisioningResource.__init__(self, parent, recordType)
 
 class CalendarHomeUIDProvisioningFile (AutoProvisioningFileMixIn, DirectoryCalendarHomeUIDProvisioningResource, DAVFile):
-    def __init__(self, path, parent):
+    def __init__(self, path, parent, homeResourceClass=None):
         """
         @param path: the path to the file which will back the resource.
         """
         DAVFile.__init__(self, path)
         DirectoryCalendarHomeUIDProvisioningResource.__init__(self, parent)
+        if homeResourceClass is None:
+            self.homeResourceClass = CalendarHomeFile
+        else:
+            self.homeResourceClass = homeResourceClass
 
     def provisionChild(self, name):
         record = self.directory.recordWithGUID(name)
@@ -488,7 +492,7 @@
             return None
 
         childPath = self.fp.child(name)
-        child = CalendarHomeFile(childPath.path, self, record)
+        child = self.homeResourceClass(childPath.path, self, record)
         if not child.exists():
             self.provision()
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080402/0885d9c6/attachment.html


More information about the calendarserver-changes mailing list