[CalendarServer-changes] [3806] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 10 12:53:15 PDT 2009


Revision: 3806
          http://trac.macosforge.org/projects/calendarserver/changeset/3806
Author:   wsanchez at apple.com
Date:     2009-03-10 12:53:15 -0700 (Tue, 10 Mar 2009)
Log Message:
-----------
Move XMLReponse to twext.web2.http

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

Added Paths:
-----------
    CalendarServer/trunk/twext/web2/
    CalendarServer/trunk/twext/web2/__init__.py
    CalendarServer/trunk/twext/web2/http.py

Modified: CalendarServer/trunk/twext/__init__.py
===================================================================
--- CalendarServer/trunk/twext/__init__.py	2009-03-10 19:40:10 UTC (rev 3805)
+++ CalendarServer/trunk/twext/__init__.py	2009-03-10 19:53:15 UTC (rev 3806)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
+# Copyright (c) 2005-2009 Apple Inc. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.

Added: CalendarServer/trunk/twext/web2/__init__.py
===================================================================
--- CalendarServer/trunk/twext/web2/__init__.py	                        (rev 0)
+++ CalendarServer/trunk/twext/web2/__init__.py	2009-03-10 19:53:15 UTC (rev 3806)
@@ -0,0 +1,19 @@
+##
+# Copyright (c) 2009 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+Extentions to twisted.web2
+"""

Added: CalendarServer/trunk/twext/web2/http.py
===================================================================
--- CalendarServer/trunk/twext/web2/http.py	                        (rev 0)
+++ CalendarServer/trunk/twext/web2/http.py	2009-03-10 19:53:15 UTC (rev 3806)
@@ -0,0 +1,39 @@
+##
+# Copyright (c) 2005-2009 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+Extensions to twisted.web2.http
+"""
+
+__all__ = [
+    "XMLResponse",
+]
+
+from twisted.web2.http import Response
+from twisted.web2.http_headers import MimeType
+
+
+class XMLResponse (Response):
+    """
+    XML L{Response} object.
+    Renders itself as an XML document.
+    """
+    def __init__(self, code, element):
+        """
+        @param xml_responses: an iterable of davxml.Response objects.
+        """
+        Response.__init__(self, code, stream=element.toxml())
+        self.headers.setHeader("content-type", MimeType("text", "xml"))

Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py	2009-03-10 19:40:10 UTC (rev 3805)
+++ CalendarServer/trunk/twistedcaldav/extensions.py	2009-03-10 19:53:15 UTC (rev 3806)
@@ -25,7 +25,6 @@
     "DAVFile",
     "ReadOnlyWritePropertiesResourceMixIn",
     "ReadOnlyResourceMixIn",
-    "XMLResponse",
     "CachingXattrPropertyStore",
 ]
 
@@ -1041,18 +1040,6 @@
         # inheritance rules, etc.                                               
         return succeed(self.defaultAccessControlList())
 
-class XMLResponse (Response):
-    """
-    XML L{Response} object.
-    Renders itself as an XML document.
-    """
-    def __init__(self, code, element):
-        """
-        @param xml_responses: an iterable of davxml.Response objects.
-        """
-        Response.__init__(self, code, stream=element.toxml())
-        self.headers.setHeader("content-type", MimeType("text", "xml"))
-
 class PropertyNotFoundError (HTTPError):
     def __init__(self, qname):
         HTTPError.__init__(self,

Modified: CalendarServer/trunk/twistedcaldav/timezoneservice.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/timezoneservice.py	2009-03-10 19:40:10 UTC (rev 3805)
+++ CalendarServer/trunk/twistedcaldav/timezoneservice.py	2009-03-10 19:53:15 UTC (rev 3806)
@@ -30,9 +30,10 @@
 from twisted.web2.http_headers import MimeType
 from twisted.web2.stream import MemoryStream
 
+from twext.web2.http import XMLResponse
+
 from twistedcaldav import customxml
 from twistedcaldav.customxml import calendarserver_namespace
-from twistedcaldav.extensions import XMLResponse
 from twistedcaldav.ical import parse_date_or_datetime
 from twistedcaldav.ical import tzexpand
 from twistedcaldav.resource import CalDAVResource
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090310/ac8af8a6/attachment-0001.html>


More information about the calendarserver-changes mailing list