~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: John Arbash Meinel
  • Date: 2010-01-04 20:23:47 UTC
  • mto: This revision was merged to the branch mainline in revision 4934.
  • Revision ID: john@arbash-meinel.com-20100104202347-ie7sj0wqz0mygmrn
Switch to KiB/K for each value. Don't display if there are no bytes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
428
428
                transfer_time = 0.001
429
429
            bps = self._total_byte_count / transfer_time
430
430
 
431
 
        msg = ('Transferred: %.3fMiB'
432
 
               ' (%.1fKiB/s r:%.3fMiB w:%.3fMiB'
433
 
               % (self._total_byte_count / 1024. / 1024.,
 
431
        msg = ('Transferred: %.0fKiB'
 
432
               ' (%.1fK/s r:%.0fK w:%.0fK'
 
433
               % (self._total_byte_count / 1024.,
434
434
                  bps / 1024.,
435
 
                  self._bytes_by_direction['read'] / 1024. / 1024.,
436
 
                  self._bytes_by_direction['write'] / 1024. / 1024.,
 
435
                  self._bytes_by_direction['read'] / 1024.,
 
436
                  self._bytes_by_direction['write'] / 1024.,
437
437
                 ))
438
438
        if self._bytes_by_direction['unknown'] > 0:
439
 
            msg += ' u:%.3fMiB)' % (
440
 
                self._bytes_by_direction['unknown'] / 1024. / 1024.
 
439
            msg += ' u:%.0fK)' % (
 
440
                self._bytes_by_direction['unknown'] / 1024.
441
441
                )
442
442
        else:
443
443
            msg += ')'
446
446
    def log_transport_activity(self, display=False):
447
447
        msg = self._format_bytes_by_direction()
448
448
        trace.mutter(msg)
449
 
        if display:
 
449
        if display and self._total_byte_count > 0:
450
450
            self.clear()
451
451
            self._term_file.write(msg + '\n')
452
452