[CalendarServer-changes] [293] CalendarServer/trunk/lib-patches/Twisted

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 23 21:40:42 PDT 2006


Revision: 293
          http://trac.macosforge.org/projects/calendarserver/changeset/293
Author:   wsanchez at apple.com
Date:     2006-10-23 21:40:42 -0700 (Mon, 23 Oct 2006)

Log Message:
-----------
update patches

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.propfind.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.static.patch

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.propfind.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.propfind.patch	2006-10-24 04:31:07 UTC (rev 292)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.propfind.patch	2006-10-24 04:40:42 UTC (rev 293)
@@ -1,6 +1,6 @@
 Index: twisted/web2/dav/method/propfind.py
 ===================================================================
---- twisted/web2/dav/method/propfind.py	(revision 18375)
+--- twisted/web2/dav/method/propfind.py	(revision 18479)
 +++ twisted/web2/dav/method/propfind.py	(working copy)
 @@ -102,11 +102,15 @@
  
@@ -20,23 +20,31 @@
      x = waitForDeferred(d)
      yield x
      x.getResult()
-@@ -116,11 +120,11 @@
-             uri = normalizeURL(request_uri)
-             if self.isCollection() and not uri.endswith("/"): uri += "/"
+@@ -117,15 +121,15 @@
+             if self.isCollection() and not uri.endswith("/"):
+                 uri += "/"
  
--        resource_properties = waitForDeferred(resource.listProperties(request))
--        yield resource_properties
--        resource_properties = resource_properties.getResult()
+-        try:
+-            resource_properties = waitForDeferred(resource.listProperties(request))
+-            yield resource_properties
+-            resource_properties = resource_properties.getResult()
+-        except:
+-            log.err("Unable to get properties for resource %r" % (resource,))
+-            raise
 +        if search_properties is "names":
-+            resource_properties = waitForDeferred(resource.listProperties(request))
-+            yield resource_properties
-+            resource_properties = resource_properties.getResult()
++            try:
++                resource_properties = waitForDeferred(resource.listProperties(request))
++                yield resource_properties
++                resource_properties = resource_properties.getResult()
++            except:
++                log.err("Unable to get properties for resource %r" % (resource,))
++                raise
  
 -        if search_properties is "names":
              properties_by_status = {
                  responsecode.OK: [propertyName(p) for p in resource_properties]
              }
-@@ -138,7 +142,10 @@
+@@ -143,7 +147,10 @@
                  properties_to_enumerate = search_properties
  
              for property in properties_to_enumerate:

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2006-10-24 04:31:07 UTC (rev 292)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2006-10-24 04:40:42 UTC (rev 293)
@@ -1,6 +1,6 @@
 Index: twisted/web2/dav/resource.py
 ===================================================================
---- twisted/web2/dav/resource.py	(revision 18375)
+--- twisted/web2/dav/resource.py	(revision 18479)
 +++ twisted/web2/dav/resource.py	(working copy)
 @@ -130,6 +130,8 @@
          (dav_namespace, "acl-restrictions"          ), # RFC 3744, section 5.6
@@ -26,7 +26,7 @@
          return succeed(qname in self.liveProperties or self.deadProperties().contains(qname))
  
      def readProperty(self, property, request):
-@@ -272,6 +282,32 @@
+@@ -286,7 +296,33 @@
                          d.addCallback(gotACL)
                          return d
                      return ifAllowed((davxml.ReadACL(),), callback)
@@ -43,7 +43,7 @@
 +                    d = self.quota(request)
 +                    d.addCallback(callback)
 +                    return d
-+
+ 
 +                if name == "quota-used-bytes":
 +                    def callback(qvalue):
 +                        if qvalue is None:
@@ -56,10 +56,11 @@
 +                    d = self.quota(request)
 +                    d.addCallback(callback)
 +                    return d
- 
++
              elif namespace == twisted_dav_namespace:
                  if name == "resource-class":
-@@ -352,6 +388,18 @@
+                     class ResourceClass (davxml.WebDAVTextElement):
+@@ -366,12 +402,26 @@
          # FIXME: A set would be better here, that that's a python 2.4+ feature.
          qnames = list(self.liveProperties)
  
@@ -78,18 +79,16 @@
          for qname in self.deadProperties().list():
              if (qname not in qnames) and (qname[0] != twisted_private_namespace):
                  qnames.append(qname)
-@@ -356,7 +404,9 @@
-             if (qname not in qnames) and (qname[0] != twisted_private_namespace):
-                 qnames.append(qname)
  
 -        return succeed(qnames)
 +        yield qnames
-+
-+    listProperties = deferredGenerator(listProperties)
  
++    listProperties = deferredGenerator(listProperties)
++
      def listAllprop(self, request):
          """
-@@ -474,7 +524,7 @@
+         Some DAV properties should not be returned to a C{DAV:allprop} query.
+@@ -488,7 +538,7 @@
          """
          unimplemented(self)
  
@@ -98,25 +97,25 @@
          """
          See L{IDAVResource.findChildren}.
  
-@@ -491,7 +541,7 @@
+@@ -512,7 +562,7 @@
              if privileges is None:
                  return child
     
--            ca = child.checkPrivileges(request, privileges)
-+            ca = child.checkPrivileges(request, privileges, inherited_aces=inherited_aces)
-             ca.addCallback(lambda _: child)
-             return ca
+-            d = child.checkPrivileges(request, privileges)
++            d = child.checkPrivileges(request, privileges, inherited_aces=inherited_aces)
+             d.addCallback(lambda _: child)
+             return d
  
-@@ -514,7 +564,7 @@
+@@ -535,7 +585,7 @@
                  completionDeferred.callback(None)
              else:
                  childpath = joinURL(basepath, childname)
 -                child = request.locateResource(childpath)
-+                child = request.locateChildResource(self, childname)
-                 child.addCallback(_checkPrivileges)
-                 child.addCallbacks(_gotChild, _checkPrivilegesError, (childpath,))
++                child = request.locateChildResource(childpath)
+                 child.addCallback(checkPrivileges)
+                 child.addCallbacks(gotChild, checkPrivilegesError, (childpath,))
                  child.addErrback(completionDeferred.errback)
-@@ -530,6 +580,43 @@
+@@ -544,6 +594,43 @@
  
          return completionDeferred
  
@@ -160,7 +159,7 @@
      def supportedReports(self):
          """
          See L{IDAVResource.supportedReports}.
-@@ -904,10 +991,11 @@
+@@ -918,10 +1005,11 @@
  
          resources = [(self, None)]
  
@@ -176,7 +175,7 @@
  
          for resource, uri in resources:
              acl = waitForDeferred(resource.accessControlList(request, inherited_aces=inherited_aces))
-@@ -1004,7 +1092,6 @@
+@@ -1018,7 +1106,6 @@
              url = request.urlForResource(self)
  
              assert url is not None, "urlForResource(self) returned None for resource %s" % (self,)
@@ -184,7 +183,7 @@
              return url
  
          try:
-@@ -1501,6 +1588,265 @@
+@@ -1515,6 +1602,265 @@
          return None
  
      ##
@@ -450,7 +449,7 @@
      # HTTP
      ##
  
-@@ -1548,7 +1894,7 @@
+@@ -1562,7 +1908,7 @@
      """
      DAV resource with no children.
      """
@@ -459,7 +458,7 @@
          return succeed(None)
  
  class DAVPrincipalResource (DAVLeafResource):
-@@ -1574,7 +1920,7 @@
+@@ -1588,7 +1934,7 @@
      def isCollection(self):
          return False
  
@@ -468,7 +467,7 @@
          return succeed(None)
  
      def readProperty(self, property, request):
-@@ -1702,6 +2048,37 @@
+@@ -1716,6 +2062,37 @@
  davxml.registerElement(TwistedACLInheritable)
  davxml.ACE.allowed_children[(twisted_dav_namespace, "inheritable")] = (0, 1)
  

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.static.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.static.patch	2006-10-24 04:31:07 UTC (rev 292)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.static.patch	2006-10-24 04:40:42 UTC (rev 293)
@@ -1,6 +1,6 @@
 Index: twisted/web2/dav/static.py
 ===================================================================
---- twisted/web2/dav/static.py	(revision 18375)
+--- twisted/web2/dav/static.py	(revision 18479)
 +++ twisted/web2/dav/static.py	(working copy)
 @@ -28,16 +28,16 @@
  
@@ -8,10 +8,10 @@
  
 -import os
 -
--from twisted.python import log
- from twisted.internet.defer import succeed, deferredGenerator, waitForDeferred
++from twisted.internet.defer import succeed, deferredGenerator, waitForDeferred
+ from twisted.python import log
+-from twisted.internet.defer import succeed, deferredGenerator, waitForDeferred
 -from twisted.web2.static import File
-+from twisted.python import log
 +from twisted.web2 import http_headers
  from twisted.web2 import responsecode, dirlist
 -from twisted.web2.http import RedirectResponse
@@ -96,28 +96,24 @@
      # Workarounds for issues with File
      ##
  
-@@ -133,11 +182,22 @@
+@@ -157,11 +206,17 @@
                      # Render from the index file
                      standin = self.createSimilarFile(ifp.path)
                  else:
-+                    # Do some optimisation of access control calculation by determining any inherited ACLs outside of
-+                    # the child resource loop and supply those to the checkPrivileges on each child.
-+                    filteredaces = waitForDeferred(self.inheritedACEsforChildren(request))
-+                    yield filteredaces
-+                    filteredaces = filteredaces.getResult()
++                    filtered_aces = waitForDeferred(self.inheritedACEsforChildren(request))
++                    yield filtered_aces
++                    filtered_aces = filtered_aces.getResult()
 +
                      children = []
  
-+                    def _childname(r, u):
-+                        u = u.rstrip("/")
-+                        children.append(u.split("/")[-1])
-+
-                     d = self.findChildren('1', request,
+-                    d = self.findChildren("1", request,
 -                                          lambda r,u: children.append(os.path.basename(u)),
 -                                          (davxml.Read(),))
-+                                          _childname,
-+                                          (davxml.Read(),),
-+                                          inherited_aces=filteredaces)
++                    def found(request, uri):
++                        children.append(uri.split("/")[-1].rstrip("/"))
++
++                    d = self.findChildren("1", request, found, (davxml.Read(),),
++                                          inherited_aces=filtered_aces)
                      d = waitForDeferred(d)
                      yield d
                      d = d.getResult()

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


More information about the calendarserver-changes mailing list