duplicity.backends.webdavbackend module

class duplicity.backends.webdavbackend.CustomMethodRequest(method, *args, **kwargs)[source]

Bases: Request

This request subclass allows explicit specification of the HTTP request method. Basic urllib.request.Request class chooses GET or POST depending on self.has_data()

__init__(method, *args, **kwargs)[source]
get_method()[source]

Return a string indicating the HTTP request method.

class duplicity.backends.webdavbackend.VerifiedHTTPSConnection(*args, **kwargs)[source]

Bases: HTTPSConnection

__init__(*args, **kwargs)[source]
connect()[source]

Connect to a host on a given (SSL) port.

request(*args, **kwargs)[source]

Send a complete request to the server.

class duplicity.backends.webdavbackend.WebDAVBackend(parsed_url)[source]

Bases: Backend

Backend for accessing a WebDAV repository.

webdav backend contributed in 2006 by Jesper Zedlitz <jesper@zedlitz.de>

__init__(parsed_url)[source]
_close()[source]
_delete(filename)[source]
_get(remote_filename, local_path)[source]
_list()[source]
_put(source_path, remote_filename)[source]
_retry_cleanup()[source]
connect(forced=False)[source]

Connect or re-connect to the server, updates self.conn # reconnect on errors as a precaution, there are errors e.g. # “[Errno 32] Broken pipe” or SSl errors that render the connection unusable

getText(nodelist)[source]
get_authorization(response, path)[source]

Fetches the auth header based on the requested method (basic or digest)

get_basic_authorization()[source]

Returns the basic auth header

get_digest_authorization(path)[source]

Returns the digest auth header

get_kerberos_authorization()[source]
listbody = '<?xml version="1.0"?><D:propfind xmlns:D="DAV:"><D:prop><D:resourcetype/></D:prop></D:propfind>'

Connect to remote store using WebDAV Protocol

makedir()[source]

Make (nested) directories on the server.

parse_digest_challenge(challenge_string)[source]
request(method, path, data=None, redirected=0)[source]

Wraps the connection.request method to retry once if authentication is required

sanitize_path(path)[source]
taste_href(href)[source]

Internal helper to taste the given href node and, if it is a duplicity file, collect it as a result file.

@return: A matching filename, or None if the href did not match.