[CalendarServer-changes] [331]
CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch
source_changes at macosforge.org
source_changes at macosforge.org
Fri Oct 27 16:45:21 PDT 2006
Revision: 331
http://trac.macosforge.org/projects/calendarserver/changeset/331
Author: wsanchez at apple.com
Date: 2006-10-27 16:45:21 -0700 (Fri, 27 Oct 2006)
Log Message:
-----------
Fix the docstring for locateChildResource().
Modified Paths:
--------------
CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch
Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch 2006-10-27 23:44:13 UTC (rev 330)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch 2006-10-27 23:45:21 UTC (rev 331)
@@ -113,7 +113,7 @@
#
# Parse the URL
#
-@@ -414,11 +431,48 @@
+@@ -414,11 +431,53 @@
def notFound(f):
f.trap(http.HTTPError)
if f.response.code != responsecode.NOT_FOUND:
@@ -127,10 +127,14 @@
+ d.addErrback(notFound)
+ return d
-+ def locateChildResource(self, res, childpath):
++ def locateChildResource(self, resource, child_path):
+ """
-+ Looks up the child resource with the given name given the parent resource.
-+ @param uri: The URL last path segment of the desired resource.
++ Looks up the child resource with the given name given the parent
++ resource. This is similar to locateResource(), but doesn't have to
++ start the lookup from the root resource, so it is potentially faster.
++ @param resource: the parent of the resource being looked up.
++ @param child_path: the path of the resource being looked up, relative
++ to C{parent}.
+ @return: a L{Deferred} resulting in the L{IResource} at the
+ given URL or C{None} if no such resource can be located.
+ @raise HTTPError: If C{url} is not a URL on the site that this
@@ -140,15 +144,16 @@
+ The contained response will have a status code of
+ L{responsecode.BAD_REQUEST}.
+ """
-+ if res is None or childpath is None: return None
++ if resource is None or child_path is None:
++ return None
+
-+ url = joinURL(self.urlForResource(res), childpath)
++ url = joinURL(self.urlForResource(resource), child_path)
+
+ cached = self._urlsByResource.get(url, None)
+ if cached is not None:
+ return succeed(cached)
+
-+ segment = unquote(childpath)
++ segment = unquote(child_path)
+
+ def notFound(f):
+ f.trap(http.HTTPError)
@@ -156,7 +161,7 @@
+ return f
+ return None
+
-+ d = defer.maybeDeferred(self._getChild, None, res, [segment], updatepaths=False)
++ d = defer.maybeDeferred(self._getChild, None, resource, [segment], updatepaths=False)
+ d.addCallback(self._rememberResource, url)
+ d.addErrback(notFound)
+ return d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061027/2c017eb4/attachment.html
More information about the calendarserver-changes
mailing list