[CalendarServer-changes] [8608] CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 31 10:39:03 PST 2012


Revision: 8608
          http://trac.macosforge.org/projects/calendarserver/changeset/8608
Author:   cdaboo at apple.com
Date:     2012-01-31 10:39:03 -0800 (Tue, 31 Jan 2012)
Log Message:
-----------
Add Brief header support.

Modified Paths:
--------------
    CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/definitions/headers.py
    CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/propfindbase.py
    CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/proppatch.py
    CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/report.py
    CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/session.py

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/definitions/headers.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/definitions/headers.py	2012-01-31 02:27:52 UTC (rev 8607)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/definitions/headers.py	2012-01-31 18:39:03 UTC (rev 8608)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2007-2008 Apple Inc. All rights reserved.
+# Copyright (c) 2007-2012 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.
@@ -37,3 +37,4 @@
 Timeout = "Timeout"
 TimeoutSeconds = "Second-"
 TimeoutInfinite = "Infinite"
+Brief = "Brief"                 # MS extension

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/propfindbase.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/propfindbase.py	2012-01-31 02:27:52 UTC (rev 8607)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/propfindbase.py	2012-01-31 18:39:03 UTC (rev 8608)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2007-2008 Apple Inc. All rights reserved.
+# Copyright (c) 2007-2012 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.
@@ -14,11 +14,11 @@
 # limitations under the License.
 ##
 
+from StringIO import StringIO
+from caldavclientlibrary.protocol.http.data.string import RequestDataString
+from caldavclientlibrary.protocol.webdav.definitions import headers
+from caldavclientlibrary.protocol.webdav.definitions import methods
 from caldavclientlibrary.protocol.webdav.requestresponse import RequestResponse
-from caldavclientlibrary.protocol.webdav.definitions import methods
-from caldavclientlibrary.protocol.webdav.definitions import headers
-from caldavclientlibrary.protocol.http.data.string import RequestDataString
-from StringIO import StringIO
 
 class PropFindBase(RequestResponse):
 
@@ -43,6 +43,10 @@
         
         # Add depth header
         hdrs.append((headers.Depth, self.depth))
-
+        
+        # Optional ones
+        if self.session.useBriefHeader:
+            hdrs.append((headers.Brief, "t"))
+            
     def generateXML(self, os):
         raise NotImplementedError

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/proppatch.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/proppatch.py	2012-01-31 02:27:52 UTC (rev 8607)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/proppatch.py	2012-01-31 18:39:03 UTC (rev 8608)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2007-2008 Apple Inc. All rights reserved.
+# Copyright (c) 2007-2012 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.
@@ -14,14 +14,14 @@
 # limitations under the License.
 ##
 
-from xml.etree.ElementTree import Element
-from caldavclientlibrary.protocol.webdav.definitions import davxml
+from StringIO import StringIO
+from caldavclientlibrary.protocol.http.data.string import RequestDataString
 from caldavclientlibrary.protocol.utils.xmlhelpers import BetterElementTree
+from caldavclientlibrary.protocol.webdav.definitions import davxml, headers
+from caldavclientlibrary.protocol.webdav.definitions import methods
 from caldavclientlibrary.protocol.webdav.requestresponse import RequestResponse
+from xml.etree.ElementTree import Element
 from xml.etree.ElementTree import SubElement
-from caldavclientlibrary.protocol.webdav.definitions import methods
-from caldavclientlibrary.protocol.http.data.string import RequestDataString
-from StringIO import StringIO
 
 class PropPatch(RequestResponse):
 
@@ -41,6 +41,14 @@
     def setOutput(self, response_data):
         self.response_data = response_data
 
+    def addHeaders(self, hdrs):
+        # Do default
+        super(PropPatch, self).addHeaders(hdrs)
+        
+        # Optional ones
+        if self.session.useBriefHeader:
+            hdrs.append((headers.Brief, "t"))
+            
     def generateXML(self, os):
         # Structure of document is:
         #

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/report.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/report.py	2012-01-31 02:27:52 UTC (rev 8607)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/report.py	2012-01-31 18:39:03 UTC (rev 8608)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2007-2011 Apple Inc. All rights reserved.
+# Copyright (c) 2007-2012 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.
@@ -14,8 +14,8 @@
 # limitations under the License.
 ##
 
+from caldavclientlibrary.protocol.webdav.definitions import methods, headers
 from caldavclientlibrary.protocol.webdav.requestresponse import RequestResponse
-from caldavclientlibrary.protocol.webdav.definitions import methods
 
 class Report(RequestResponse):
 
@@ -24,3 +24,12 @@
 
     def setOutput(self, response_data):
         self.response_data = response_data;
+
+    def addHeaders(self, hdrs):
+        # Do default
+        super(RequestResponse, self).addHeaders(hdrs)
+        
+        # Optional ones
+        if self.session.useBriefHeader:
+            hdrs.append((headers.Brief, "t"))
+    

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/session.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/session.py	2012-01-31 02:27:52 UTC (rev 8607)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/protocol/webdav/session.py	2012-01-31 18:39:03 UTC (rev 8608)
@@ -1,5 +1,5 @@
 ##
-# Copyright (c) 2007-2008 Apple Inc. All rights reserved.
+# Copyright (c) 2007-2012 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.
@@ -14,11 +14,11 @@
 # limitations under the License.
 ##
 
-from caldavclientlibrary.protocol.http.session import Session as HTTPSession
-from caldavclientlibrary.protocol.http.requestresponse import RequestResponse
 from caldavclientlibrary.protocol.http.data.string import ResponseDataString
 from caldavclientlibrary.protocol.http.definitions import methods
 from caldavclientlibrary.protocol.http.definitions import statuscodes
+from caldavclientlibrary.protocol.http.requestresponse import RequestResponse
+from caldavclientlibrary.protocol.http.session import Session as HTTPSession
 from caldavclientlibrary.protocol.webdav.definitions import headers
 
 class Session(HTTPSession):
@@ -27,6 +27,9 @@
         super(Session, self).__init__(server, port, ssl, log)
         self.initialised = False
         self.version = ()
+        
+        # Features for entire session
+        self.useBriefHeader = True
 
     def initialise(self, host, base_uri):
         # Set host change
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120131/6b2b7f69/attachment.html>


More information about the calendarserver-changes mailing list