~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-09 17:15:17 UTC
  • mto: (5029.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5030.
  • Revision ID: v.ladeuil+lp@free.fr-20100209171517-1wzz1nh3d3nhnkbu
Move ReadonlyServer to bzrlib.tests.readonly

Show diffs side-by-side

added added

removed removed

Lines of Context:
417
417
        elif now >= (self._transport_update_time + 0.5):
418
418
            # guard against clock stepping backwards, and don't update too
419
419
            # often
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,))
 
420
            rate = (self._bytes_since_update
 
421
                    / (now - self._transport_update_time))
 
422
            # using base-10 units (see HACKING.txt).
 
423
            msg = ("%6dkB %5dkB/s" %
 
424
                    (self._total_byte_count / 1000, int(rate) / 1000,))
423
425
            self._transport_update_time = now
424
426
            self._last_repaint = now
425
427
            self._bytes_since_update = 0
435
437
                transfer_time = 0.001
436
438
            bps = self._total_byte_count / transfer_time
437
439
 
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.,
 
440
        # using base-10 units (see HACKING.txt).
 
441
        msg = ('Transferred: %.0fkB'
 
442
               ' (%.1fkB/s r:%.0fkB w:%.0fkB'
 
443
               % (self._total_byte_count / 1000.,
 
444
                  bps / 1000.,
 
445
                  self._bytes_by_direction['read'] / 1000.,
 
446
                  self._bytes_by_direction['write'] / 1000.,
444
447
                 ))
445
448
        if self._bytes_by_direction['unknown'] > 0:
446
 
            msg += ' u:%.0fK)' % (
447
 
                self._bytes_by_direction['unknown'] / 1024.
 
449
            msg += ' u:%.0fkB)' % (
 
450
                self._bytes_by_direction['unknown'] / 1000.
448
451
                )
449
452
        else:
450
453
            msg += ')'