duplicity-team team mailing list archive
-
duplicity-team team
-
Mailing list archive
-
Message #04079
[Merge] lp:~m4ktub/duplicity/0.7-fixes into lp:duplicity/0.7-series
Claudio Gil has proposed merging lp:~m4ktub/duplicity/0.7-fixes into lp:duplicity/0.7-series.
Requested reviews:
duplicity-team (duplicity-team)
For more details, see:
https://code.launchpad.net/~m4ktub/duplicity/0.7-fixes/+merge/314778
Added progress report to the Backblaze backend.
--
Your team duplicity-team is requested to review the proposed merge of lp:~m4ktub/duplicity/0.7-fixes into lp:duplicity/0.7-series.
=== modified file 'duplicity/backends/b2backend.py'
--- duplicity/backends/b2backend.py 2016-11-21 20:19:04 +0000
+++ duplicity/backends/b2backend.py 2017-01-15 11:00:53 +0000
@@ -28,6 +28,7 @@
import duplicity.backend
from duplicity.errors import BackendException, FatalBackendException
from duplicity import log
+from duplicity import progress
import json
import urllib2
@@ -114,15 +115,19 @@
info = self.get_upload_info(self.bucket_id)
url = info['uploadUrl']
+ file_size = os.path.getsize(source_path.name)
+ progress.report_transfer(0, file_size)
+
headers = {
'Authorization': info['authorizationToken'],
'X-Bz-File-Name': remote_filename,
'Content-Type': content_type,
'X-Bz-Content-Sha1': digest,
- 'Content-Length': str(os.path.getsize(source_path.name)),
+ 'Content-Length': str(file_size),
}
data_file = source_path.open()
self.get_or_post(url, None, headers, data_file=data_file)
+ progress.report_transfer(file_size, file_size)
def _list(self):
"""
Follow ups