~carlos-abalde/duplicity/google-docs

« back to all changes in this revision

Viewing changes to duplicity/backends/u1backend.py

  • Committer: Kenneth Loafman
  • Date: 2011-06-22 11:38:14 UTC
  • mfrom: (753.1.1 duplicity)
  • Revision ID: kenneth@loafman.com-20110622113814-qomvgy1y85uijokx
Ignore 404 errors when we try to delete a file on Ubuntu One.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
        import urllib
99
99
        return urllib.quote(url, safe="/~")
100
100
 
101
 
    def handle_error(self, op, headers, file1=None, file2=None):
 
101
    def handle_error(self, op, headers, file1=None, file2=None, ignore=None):
102
102
        from duplicity import log
103
103
        from duplicity import util
104
104
        import json
107
107
        if status >= 200 and status < 300:
108
108
            return
109
109
 
 
110
        if ignore and status in ignore:
 
111
            return
 
112
 
110
113
        if status == 400:
111
114
            code = log.ErrorCode.backend_permission_denied
112
115
        elif status == 404:
192
195
        for filename in filename_list:
193
196
            remote_full = self.meta_base + self.quote(filename)
194
197
            answer = auth.request(remote_full, http_method="DELETE")
195
 
            self.handle_error('delete', answer, remote_full)
 
198
            self.handle_error('delete', answer, remote_full, ignore=[404])
196
199
 
197
200
duplicity.backend.register_backend("u1", U1Backend)
198
201
duplicity.backend.register_backend("u1+http", U1Backend)