~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-02-04 16:06:36 UTC
  • mfrom: (5007 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100204160636-xqeuwz8bwt8bbts4
Merge bzr.dev 5007, resolve conflict, update NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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 += ')'