~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Gordon Tyler
  • Date: 2010-01-29 17:59:57 UTC
  • mto: (5004.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5006.
  • Revision ID: gordon@doxxx.net-20100129175957-ezsau305hs4cogxo
Changed show_transport_activity and log_transport_activity to use base-10 SI units.

Show diffs side-by-side

added added

removed removed

Lines of Context:
418
418
            # guard against clock stepping backwards, and don't update too
419
419
            # often
420
420
            rate = self._bytes_since_update / (now - self._transport_update_time)
421
 
            msg = ("%6dKB %5dKB/s" %
422
 
                    (self._total_byte_count>>10, int(rate)>>10,))
 
421
            msg = ("%6dkB %5dkB/s" %
 
422
                    (self._total_byte_count / 1000, int(rate) / 1000,))
423
423
            self._transport_update_time = now
424
424
            self._last_repaint = now
425
425
            self._bytes_since_update = 0
435
435
                transfer_time = 0.001
436
436
            bps = self._total_byte_count / transfer_time
437
437
 
438
 
        msg = ('Transferred: %.0fKiB'
439
 
               ' (%.1fK/s r:%.0fK w:%.0fK'
440
 
               % (self._total_byte_count / 1024.,
441
 
                  bps / 1024.,
442
 
                  self._bytes_by_direction['read'] / 1024.,
443
 
                  self._bytes_by_direction['write'] / 1024.,
 
438
        msg = ('Transferred: %.0fkB'
 
439
               ' (%.1fkB/s r:%.0fkB w:%.0fkB'
 
440
               % (self._total_byte_count / 1000.,
 
441
                  bps / 1000.,
 
442
                  self._bytes_by_direction['read'] / 1000.,
 
443
                  self._bytes_by_direction['write'] / 1000.,
444
444
                 ))
445
445
        if self._bytes_by_direction['unknown'] > 0:
446
 
            msg += ' u:%.0fK)' % (
447
 
                self._bytes_by_direction['unknown'] / 1024.
 
446
            msg += ' u:%.0fkB)' % (
 
447
                self._bytes_by_direction['unknown'] / 1000.
448
448
                )
449
449
        else:
450
450
            msg += ')'