duplicity.backends.adbackend module

class duplicity.backends.adbackend.ADBackend(parsed_url)[source]

Bases: Backend

Backend for Amazon Drive. It communicates directly with Amazon Drive using their RESTful API and does not rely on externally setup software (like acd_cli).

CLIENT_ID = 'amzn1.application-oa2-client.791c9c2d78444e85a32eb66f92eb6bcc'
CLIENT_SECRET = '5b322c6a37b25f16d848a6a556eddcc30314fc46ae65c87068ff1bc4588d715b'
MULTIPART_BOUNDARY = 'DuplicityFormBoundaryd66364f7f8924f7e9d478e19cf4b871d114a1e00262542'
OAUTH_AUTHORIZE_URL = 'https://www.amazon.com/ap/oa'
OAUTH_REDIRECT_URL = 'https://breunig.xyz/duplicity/copy.html'
OAUTH_SCOPE = ['clouddrive:read_other', 'clouddrive:write']
OAUTH_TOKEN_PATH = '/home/docs/.duplicity_ad_oauthtoken.json'
OAUTH_TOKEN_URL = 'https://api.amazon.com/auth/o2/token'
__init__(parsed_url)[source]
_delete(remote_filename)[source]

Delete file from Amazon Drive

_get(remote_filename, local_path)[source]

Download file from Amazon Drive

_list()[source]

List files in Amazon Drive backup folder

_put(source_path, remote_filename)[source]

Upload a local file to Amazon Drive

_query(remote_filename)[source]

Retrieve file size info from Amazon Drive

get_file_id(remote_filename)[source]

Find id of remote file in backup target folder

initialize_oauth2_session()[source]

Setup or refresh oauth2 session with Amazon Drive

mkdir(parent_node_id, folder_name)[source]

Create a new folder as a child of a parent node

multipart_stream(metadata, source_path)[source]

Generator for multipart/form-data file upload from source file

raise_for_existing_file(remote_filename)[source]

Report error when file already existed in location and delete it

read_all_pages(url)[source]

Iterates over nodes API URL until all pages were read

resolve_backup_target()[source]

Resolve node id for remote backup target folder