mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 23:12:40 +00:00
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:
1 parent
a668437d2f
commit
cb8b538e27
2 files changed
+16
-15
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user