[CalendarServer-changes] [576] CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 22 16:15:56 PST 2006


Revision: 576
          http://trac.macosforge.org/projects/calendarserver/changeset/576
Author:   wsanchez at apple.com
Date:     2006-11-22 16:15:55 -0800 (Wed, 22 Nov 2006)

Log Message:
-----------
Be persnikety about trailing '/' in URLs for resources.

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/resource.py
    CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py	2006-11-23 00:05:44 UTC (rev 575)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py	2006-11-23 00:15:55 UTC (rev 576)
@@ -54,6 +54,8 @@
         @param url: the canonical URL for the resource.
         @param directory: an L{IDirectoryService} to provision principals from.
         """
+        assert url.endswith("/"), "Collection URL must end in '/'"
+
         CalDAVFile.__init__(self, path)
 
         self._url = url

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/resource.py	2006-11-23 00:05:44 UTC (rev 575)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/resource.py	2006-11-23 00:15:55 UTC (rev 576)
@@ -546,12 +546,14 @@
         return d
 
     def __init__(self, url):
+        assert url.endswith("/"), "Collection URL must end in '/'"
+
+        super(CalendarPrincipalCollectionResource, self).__init__()
+
         self._url = url
 
         # Register self with class
         if url not in CalendarPrincipalCollectionResource.principleCollectionSet:
-            if not url.endswith("/"):
-                url += "/"
             CalendarPrincipalCollectionResource.principleCollectionSet[url] = self
 
     def isCollection(self):

Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py	2006-11-23 00:05:44 UTC (rev 575)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py	2006-11-23 00:15:55 UTC (rev 576)
@@ -446,6 +446,8 @@
         @param path: the path to the file which will back the resource.
         @param directory: an L{IDirectoryService} to provision calendars from.
         """
+        assert url.endswith("/"), "Collection URL must end in '/'"
+
         super(CalendarHomeProvisioningFile, self).__init__(path)
 
         self.directory = IDirectoryService(directory)
@@ -724,6 +726,8 @@
         @param url: the primary URL for the resource.  This is the url which
             will be returned by L{principalURL}.
         """
+        assert not url.endswith("/"), "Non-collection URL must not end in '/'"
+
         super(CalendarPrincipalFile, self).__init__(path)
 
         self._url = url

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


More information about the calendarserver-changes mailing list