[CalendarServer-changes] [319] CalendarServer/branches/users/wsanchez/acl-2/lib-patches/Twisted/ twisted.web2.iweb.patch

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 27 12:22:42 PDT 2006


Revision: 319
          http://trac.macosforge.org/projects/calendarserver/changeset/319
Author:   wsanchez at apple.com
Date:     2006-10-27 12:22:42 -0700 (Fri, 27 Oct 2006)

Log Message:
-----------
Fix adaptor bug in iweb

Added Paths:
-----------
    CalendarServer/branches/users/wsanchez/acl-2/lib-patches/Twisted/twisted.web2.iweb.patch

Added: CalendarServer/branches/users/wsanchez/acl-2/lib-patches/Twisted/twisted.web2.iweb.patch
===================================================================
--- CalendarServer/branches/users/wsanchez/acl-2/lib-patches/Twisted/twisted.web2.iweb.patch	                        (rev 0)
+++ CalendarServer/branches/users/wsanchez/acl-2/lib-patches/Twisted/twisted.web2.iweb.patch	2006-10-27 19:22:42 UTC (rev 319)
@@ -0,0 +1,32 @@
+Index: twisted/web2/iweb.py
+===================================================================
+--- twisted/web2/iweb.py	(revision 18545)
++++ twisted/web2/iweb.py	(working copy)
+@@ -41,14 +41,23 @@
+         """
+ 
+ # Is there a better way to do this than this funky extra class?
++NotSpecified = object()
+ class SpecialAdaptInterfaceClass(interface.InterfaceClass):
+     # A special adapter for IResource to handle the extra step of adapting
+     # from IOldNevowResource-providing resources.
+-    def __call__(self, other, alternate=None):
+-        result = super(SpecialAdaptInterfaceClass, self).__call__(other, alternate)
+-        if result is not alternate:
+-            return result
++    def __call__(self, other, alternate=NotSpecified):
++        if alternate == NotSpecified:
++            try:
++                return super(SpecialAdaptInterfaceClass, self).__call__(other)
++            except TypeError:
++                pass
++        else:
++            result = super(SpecialAdaptInterfaceClass, self).__call__(other, alternate)
++            if result is not alternate:
++                return result
+         
++        if alternate == NotSpecified:
++            return IOldNevowResource(other)
+         result = IOldNevowResource(other, alternate)
+         if result is not alternate:
+             return IResource(result)

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


More information about the calendarserver-changes mailing list