[CalendarServer-changes] [6315] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Mon Sep 20 09:00:39 PDT 2010


Revision: 6315
          http://trac.macosforge.org/projects/calendarserver/changeset/6315
Author:   cdaboo at apple.com
Date:     2010-09-20 09:00:37 -0700 (Mon, 20 Sep 2010)
Log Message:
-----------
Make sure timezone service requests with a trailing / are handled properly.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/extensions.py
    CalendarServer/trunk/twistedcaldav/timezoneservice.py

Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py	2010-09-20 15:59:51 UTC (rev 6314)
+++ CalendarServer/trunk/twistedcaldav/extensions.py	2010-09-20 16:00:37 UTC (rev 6315)
@@ -38,7 +38,7 @@
 from twisted.cred.error import LoginFailed, UnauthorizedLogin
 
 import twext.web2.server
-from twext.web2 import responsecode, iweb, http
+from twext.web2 import responsecode, iweb, http, server
 from twext.web2.auth.wrapper import UnauthorizedResponse
 from twext.web2.http import HTTPError, Response, RedirectResponse
 from twext.web2.http import StatusResponse
@@ -772,6 +772,23 @@
         # If getChild() finds a child resource, return it
         return (self.getChild(segments[0]), segments[1:])
 
+class DAVResourceWithoutChildrenMixin (object):
+    """
+    Bits needed from twext.web2.static
+    """
+
+    def __init__(self, principalCollections=None):
+        self.putChildren = {}
+        super(DAVResourceWithChildrenMixin, self).__init__(principalCollections=principalCollections)
+
+    def findChildren(
+        self, depth, request, callback,
+        privileges=None, inherited_aces=None
+    ):
+        return succeed(None)
+    def locateChild(self, request, segments):
+        return self, server.StopTraversal
+
 class DAVPrincipalResource (DirectoryPrincipalPropertySearchMixIn,
                             SuperDAVPrincipalResource, LoggingMixIn,
                             DirectoryRenderingMixIn):

Modified: CalendarServer/trunk/twistedcaldav/timezoneservice.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/timezoneservice.py	2010-09-20 15:59:51 UTC (rev 6314)
+++ CalendarServer/trunk/twistedcaldav/timezoneservice.py	2010-09-20 16:00:37 UTC (rev 6315)
@@ -38,7 +38,8 @@
 
 from twistedcaldav import customxml
 from twistedcaldav.customxml import calendarserver_namespace
-from twistedcaldav.extensions import DAVResource
+from twistedcaldav.extensions import DAVResource,\
+    DAVResourceWithoutChildrenMixin
 from twistedcaldav.ical import parse_date_or_datetime
 from twistedcaldav.ical import tzexpand
 from twistedcaldav.resource import ReadOnlyNoCopyResourceMixIn
@@ -46,7 +47,7 @@
 from twistedcaldav.timezones import listTZs
 from twistedcaldav.timezones import readTZ
 
-class TimezoneServiceResource (ReadOnlyNoCopyResourceMixIn, DAVResource):
+class TimezoneServiceResource (ReadOnlyNoCopyResourceMixIn, DAVResourceWithoutChildrenMixin, DAVResource):
     """
     Timezone Service resource.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100920/84acfd2e/attachment.html>


More information about the calendarserver-changes mailing list