[CalendarServer-changes] [2309]
CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/
Twisted
source_changes at macosforge.org
source_changes at macosforge.org
Mon Apr 14 11:52:19 PDT 2008
Revision: 2309
http://trac.macosforge.org/projects/calendarserver/changeset/2309
Author: wsanchez at apple.com
Date: 2008-04-14 11:52:19 -0700 (Mon, 14 Apr 2008)
Log Message:
-----------
Don't assume name and namespace are class attrs on WebDAVElement
Modified Paths:
--------------
CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/Twisted/twisted.web2.dav.element.base.patch
CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/Twisted/twisted.web2.dav.http.patch
Modified: CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/Twisted/twisted.web2.dav.element.base.patch
===================================================================
--- CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/Twisted/twisted.web2.dav.element.base.patch 2008-04-14 18:40:16 UTC (rev 2308)
+++ CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/Twisted/twisted.web2.dav.element.base.patch 2008-04-14 18:52:19 UTC (rev 2309)
@@ -63,7 +63,7 @@
for allowed, (min, max) in allowed_children.items():
if type(allowed) == type and isinstance(child, allowed):
-@@ -145,21 +171,20 @@
+@@ -145,24 +171,26 @@
if self.allowed_attributes:
for name in attributes:
@@ -92,7 +92,13 @@
self.attributes = my_attributes
-@@ -190,14 +215,93 @@
++ def emptyCopy(self):
++ return self.__class__()
++
+ def __str__(self):
+ return self.sname()
+
+@@ -190,14 +218,93 @@
return child in self.children
def writeXML(self, output):
@@ -190,7 +196,7 @@
def element(self, document):
element = document.createElementNS(self.namespace, self.name)
-@@ -285,6 +389,9 @@
+@@ -285,6 +392,9 @@
self.data = data
@@ -200,7 +206,7 @@
def __str__(self):
return str(self.data)
-@@ -324,6 +431,22 @@
+@@ -324,6 +434,22 @@
log.err("Invalid PCDATA: %r" % (self.data,))
raise
@@ -223,3 +229,22 @@
class WebDAVOneShotElement (WebDAVElement):
"""
Element with exactly one WebDAVEmptyElement child and no attributes.
+@@ -364,6 +490,18 @@
+ PCDATAElement: (0, None),
+ }
+
++ def qname(self):
++ return (self.namespace, self.name)
++
++ def sname(self):
++ return "{%s}%s" % (self.namespace, self.name)
++
++ def emptyCopy(self):
++ copied = self.__class__()
++ copied.name = self.name
++ copied.namespace = self.namespace
++ return copied
++
+ class WebDAVEmptyElement (WebDAVElement):
+ """
+ WebDAV element with no contents.
Modified: CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/Twisted/twisted.web2.dav.http.patch
===================================================================
--- CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/Twisted/twisted.web2.dav.http.patch 2008-04-14 18:40:16 UTC (rev 2308)
+++ CalendarServer/branches/release/CalendarServer-1.3-dev/lib-patches/Twisted/twisted.web2.dav.http.patch 2008-04-14 18:52:19 UTC (rev 2309)
@@ -16,3 +16,12 @@
output = davxml.Error(error).toxml()
+@@ -227,7 +226,7 @@
+
+ if len(property.children) > 0:
+ # Re-instantiate as empty element.
+- property = property.__class__()
++ property = property.emptyCopy()
+
+ if code > 400: # Error codes only
+ log.err("Error during %s for %s: %s" % (self.method, property, message))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080414/c0a9d2a3/attachment.html
More information about the calendarserver-changes
mailing list