[CalendarServer-changes] [257] CalendarServer/trunk/twistedcaldav/static.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Oct 5 17:14:31 PDT 2006


Revision: 257
          http://trac.macosforge.org/projects/calendarserver/changeset/257
Author:   wsanchez at apple.com
Date:     2006-10-05 17:14:31 -0700 (Thu, 05 Oct 2006)

Log Message:
-----------
createSimilarFile() cleanup

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/static.py

Modified: CalendarServer/trunk/twistedcaldav/static.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/static.py	2006-10-05 23:52:09 UTC (rev 256)
+++ CalendarServer/trunk/twistedcaldav/static.py	2006-10-06 00:14:31 UTC (rev 257)
@@ -424,7 +424,7 @@
 
     def createSimilarFile(self, path):
         if path == self.fp.path:
-            return ScheduleInboxFile(path)
+            return self
         else:
             return CalDAVFile(path)
 
@@ -600,7 +600,10 @@
             self.putChild(name, clazz(child_fp.path))
 
     def createSimilarFile(self, path):
-        return self.__class__(path)
+        if path == self.fp.path:
+            return self
+        else:
+            return self.CalDAVFile(path)
 
     def locateChild(self, request, segments):
         return locateExistingChild(self, request, segments)
@@ -612,9 +615,6 @@
 
         return super(CalendarHomeFile, self).getChild(name)
 
-    def createSimilarFile(self, path):
-        return CalDAVFile(path)
-
     ##
     # Quota
     ##
@@ -647,9 +647,6 @@
         """
         super(CalendarHomeProvisioningFile, self).__init__(path)
 
-    def createSimilarFile(self, path):
-        return self.__class__(path)
-
     def hasChild(self, name):
         """
         @return: C{True} if this resource has a child with the given name,
@@ -679,7 +676,7 @@
         return self.calendarHomeClass(child_fp.path)
 
     def createSimilarFile(self, path):
-        return CalDAVFile(path)
+        raise NotImplementedError("Not allowed")
 
     def http_PUT        (self, request): return responsecode.FORBIDDEN
     def http_MKCOL      (self, request): return responsecode.FORBIDDEN
@@ -870,9 +867,6 @@
         CalendarPrincipalCollectionResource.__init__(self, url)
         DAVFile.__init__(self, path)
 
-    def createSimilarFile(self, path):
-        return self.__class__(path, self.principalCollectionURL())
-
     def initialize(self, homeuri, home):
         """
         May be called during repository account initialization.
@@ -908,6 +902,9 @@
 
         return CalendarPrincipalFile(child_fp.path, joinURL(self.principalCollectionURL(), name))
 
+    def createSimilarFile(self, path):
+        raise NotImplementedError("Not allowed.")
+
     def principalSearchPropertySet(self):
         """
         See L{IDAVResource.principalSearchPropertySet}.
@@ -937,13 +934,6 @@
             ),
         )
 
-    def createSimilarFile(self, path):
-        if path == self.fp.path:
-            return self
-        else:
-            # TODO: Fix this - not sure how to get URI for second argument of __init__
-            return CalendarPrincipalFile(path, "")
-
     def http_PUT        (self, request): return responsecode.FORBIDDEN
     def http_MKCOL      (self, request): return responsecode.FORBIDDEN
     def http_MKCALENDAR (self, request): return responsecode.FORBIDDEN

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061005/2dd297f5/attachment.html


More information about the calendarserver-changes mailing list