~mgorse/duplicity/0.8-series

« back to all changes in this revision

Viewing changes to duplicity/backends/_boto_single.py

  • Committer: kenneth at loafman
  • Date: 2018-12-23 16:52:31 UTC
  • mfrom: (1340.2.5 duplicity)
  • Revision ID: kenneth@loafman.com-20181223165231-8ghio3o8kd4506g6
* Merged in lp:~mgorse/duplicity/0.8-series
  - First pass at a python 3 port.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# along with duplicity; if not, write to the Free Software Foundation,
20
20
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
21
 
 
22
from __future__ import division
 
23
from builtins import str
 
24
from past.utils import old_div
22
25
import os
23
26
import time
24
27
 
242
245
        self.upload(source_path.name, key, headers)
243
246
        upload_end = time.time()
244
247
        total_s = abs(upload_end - upload_start) or 1  # prevent a zero value!
245
 
        rough_upload_speed = os.path.getsize(source_path.name) / total_s
 
248
        rough_upload_speed = old_div(os.path.getsize(source_path.name), total_s)
246
249
        log.Debug(u"Uploaded %s/%s to %s Storage at roughly %f bytes/second" %
247
250
                  (self.straight_url, remote_filename, storage_class,
248
251
                   rough_upload_speed))