~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
            warnings.warn("%r updated but no tasks are active" %
243
243
                (task,))
244
244
        elif task != self._task_stack[-1]:
245
 
            warnings.warn("%r is not the top progress task %r" %
246
 
                (task, self._task_stack[-1]))
 
245
            # We used to check it was the top task, but it's hard to always
 
246
            # get this right and it's not necessarily useful: any actual
 
247
            # problems will be evident in use
 
248
            #warnings.warn("%r is not the top progress task %r" %
 
249
            #     (task, self._task_stack[-1]))
 
250
            pass
247
251
        self._progress_view.show_progress(task)
248
252
 
249
253
    def _progress_all_finished(self):
433
437
        elif now >= (self._transport_update_time + 0.5):
434
438
            # guard against clock stepping backwards, and don't update too
435
439
            # often
436
 
            rate = self._bytes_since_update / (now - self._transport_update_time)
437
 
            msg = ("%6dKB %5dKB/s" %
438
 
                    (self._total_byte_count>>10, int(rate)>>10,))
 
440
            rate = (self._bytes_since_update
 
441
                    / (now - self._transport_update_time))
 
442
            # using base-10 units (see HACKING.txt).
 
443
            msg = ("%6dkB %5dkB/s" %
 
444
                    (self._total_byte_count / 1000, int(rate) / 1000,))
439
445
            self._transport_update_time = now
440
446
            self._last_repaint = now
441
447
            self._bytes_since_update = 0
451
457
                transfer_time = 0.001
452
458
            bps = self._total_byte_count / transfer_time
453
459
 
454
 
        msg = ('Transferred: %.0fKiB'
455
 
               ' (%.1fK/s r:%.0fK w:%.0fK'
456
 
               % (self._total_byte_count / 1024.,
457
 
                  bps / 1024.,
458
 
                  self._bytes_by_direction['read'] / 1024.,
459
 
                  self._bytes_by_direction['write'] / 1024.,
 
460
        # using base-10 units (see HACKING.txt).
 
461
        msg = ('Transferred: %.0fkB'
 
462
               ' (%.1fkB/s r:%.0fkB w:%.0fkB'
 
463
               % (self._total_byte_count / 1000.,
 
464
                  bps / 1000.,
 
465
                  self._bytes_by_direction['read'] / 1000.,
 
466
                  self._bytes_by_direction['write'] / 1000.,
460
467
                 ))
461
468
        if self._bytes_by_direction['unknown'] > 0:
462
 
            msg += ' u:%.0fK)' % (
463
 
                self._bytes_by_direction['unknown'] / 1024.
 
469
            msg += ' u:%.0fkB)' % (
 
470
                self._bytes_by_direction['unknown'] / 1000.
464
471
                )
465
472
        else:
466
473
            msg += ')'