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

source_changes at macosforge.org source_changes at macosforge.org
Tue Oct 31 07:51:44 PST 2006


Revision: 337
          http://trac.macosforge.org/projects/calendarserver/changeset/337
Author:   cdaboo at apple.com
Date:     2006-10-31 07:51:43 -0800 (Tue, 31 Oct 2006)

Log Message:
-----------
Remove principal coolection auto-provisioning feature. Principals are always statically configured via repository.xml
or dynamically via a directory.

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

Modified: CalendarServer/trunk/twistedcaldav/static.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/static.py	2006-10-31 15:46:38 UTC (rev 336)
+++ CalendarServer/trunk/twistedcaldav/static.py	2006-10-31 15:51:43 UTC (rev 337)
@@ -27,11 +27,12 @@
     "CalendarHomeFile",
     "CalendarHomeProvisioningFile",
     "CalendarPrincipalFile",
-    "CalendarUserPrincipalProvisioningResource",
+    "CalendarPrincipalCollectionFile",
 ]
 
 import os
 import errno
+from posixpath import basename
 from urlparse import urlsplit
 
 from twisted.internet.defer import deferredGenerator, fail, succeed, waitForDeferred
@@ -849,7 +850,7 @@
             inbox.writeDeadProperty(fbset)
 
 
-class CalendarUserPrincipalProvisioningResource (CalendarPrincipalCollectionResource, DAVFile):
+class CalendarPrincipalCollectionFile (CalendarPrincipalCollectionResource, DAVFile):
     """
     L{DAVFile} resource which provisions user L{CalendarPrincipalFile} resources
     as needed.
@@ -873,34 +874,13 @@
         """
         pass
     
-    def render(self, request):
-        return StatusResponse(
-            responsecode.OK,
-            "This collection contains user principal resources",
-            title=self.displayName()
-        )
-
-    def getChild(self, name):
-        if name == "": return self
-
-        child_fp = self.fp.child(name)
-        if child_fp.exists():
-            assert child_fp.isfile()
+    def createSimilarFile(self, path):
+        if path == self.fp.path:
+            return self
         else:
-            assert self.exists()
-            assert self.isCollection()
+            # TODO: Fix this - not sure how to get URI for second argument of __init__
+            return CalendarPrincipalFile(path, joinURL(self.principalCollectionURL(), basename(path)))
 
-            # FIXME: Do a real lookup of what's valid here
-            if name[0] == ".": return None
-            if len(name) > 8: return None
-
-            child_fp.open("w").close()
-
-        return CalendarPrincipalFile(child_fp.path, joinURL(self.principalCollectionURL(), name))
-
-    def createSimilarFile(self, path):
-        raise NotImplementedError("Not allowed.")
-
     def principalSearchPropertySet(self):
         """
         See L{IDAVResource.principalSearchPropertySet}.

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


More information about the calendarserver-changes mailing list