Monotone-Parent: 3774742a6943dc4914fba97472a150d427c3f883

Monotone-Revision: 8c0c5f08cd0bdb1e303b9c4cffedc1940941869e

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-06-02T16:46:06
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-06-02 16:46:06 +00:00
parent a668437d2f
commit cb8b538e27
2 changed files with 16 additions and 15 deletions
+4
View File
@@ -1,5 +1,9 @@
2010-06-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Tests/Integration/webdavlib.py (HTTPPUT.__init__): added the
"content_type" and "exclusive" optional parameters. The latter
implies the use of the "if-none-match" header.
* SoObjects/SOGo/WORequest+SOGo.m (-handledByDefaultHandler):
fixed a bug where the -requestHandlerKey method would be invoked
on the "request" (NGHttpRequest) ivar rather than on self.
+12 -15
View File
@@ -150,13 +150,24 @@ class HTTPQuery(HTTPSimpleQuery):
class HTTPPUT(HTTPQuery):
method = "PUT"
def __init__(self, url, content):
def __init__(self, url, content,
content_type="application/octet-stream",
exclusive=False):
HTTPQuery.__init__(self, url)
self.content = content
self.content_type = content_type
self.exclusive = exclusive
def render(self):
return self.content
def prepare_headers(self):
headers = HTTPQuery.prepare_headers(self)
if self.exclusive:
headers["if-none-match"] = "*"
return headers
class HTTPPOST(HTTPPUT):
method = "POST"
@@ -260,20 +271,6 @@ class WebDAVMOVE(WebDAVQuery):
headers["Host"] = self.host
return headers
class WebDAVPUT(WebDAVQuery):
method = "PUT"
def __init__(self, url, content):
WebDAVQuery.__init__(self, url)
self.content_type = "text/plain; charset=utf-8"
self.content = content
def prepare_headers(self):
return WebDAVQuery.prepare_headers(self)
def render(self):
return self.content
class WebDAVPrincipalPropertySearch(WebDAVREPORT):
def __init__(self, url, properties, matches):
WebDAVQuery.__init__(self, url)