~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-17 13:49:11 UTC
  • mfrom: (4988.11.1 imports)
  • Revision ID: pqm@pqm.ubuntu.com-20100217134911-s77se00ni7xc1hz8
(Jelmer) Remove some unused imports.

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
238
238
            warnings.warn("%r updated but no tasks are active" %
239
239
                (task,))
240
240
        elif task != self._task_stack[-1]:
241
 
            warnings.warn("%r is not the top progress task %r" %
242
 
                (task, self._task_stack[-1]))
 
241
            # We used to check it was the top task, but it's hard to always
 
242
            # get this right and it's not necessarily useful: any actual
 
243
            # problems will be evident in use
 
244
            #warnings.warn("%r is not the top progress task %r" %
 
245
            #     (task, self._task_stack[-1]))
 
246
            pass
243
247
        self._progress_view.show_progress(task)
244
248
 
245
249
    def _progress_all_finished(self):
417
421
        elif now >= (self._transport_update_time + 0.5):
418
422
            # guard against clock stepping backwards, and don't update too
419
423
            # 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,))
 
424
            rate = (self._bytes_since_update
 
425
                    / (now - self._transport_update_time))
 
426
            # using base-10 units (see HACKING.txt).
 
427
            msg = ("%6dkB %5dkB/s" %
 
428
                    (self._total_byte_count / 1000, int(rate) / 1000,))
423
429
            self._transport_update_time = now
424
430
            self._last_repaint = now
425
431
            self._bytes_since_update = 0
435
441
                transfer_time = 0.001
436
442
            bps = self._total_byte_count / transfer_time
437
443
 
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.,
 
444
        # using base-10 units (see HACKING.txt).
 
445
        msg = ('Transferred: %.0fkB'
 
446
               ' (%.1fkB/s r:%.0fkB w:%.0fkB'
 
447
               % (self._total_byte_count / 1000.,
 
448
                  bps / 1000.,
 
449
                  self._bytes_by_direction['read'] / 1000.,
 
450
                  self._bytes_by_direction['write'] / 1000.,
444
451
                 ))
445
452
        if self._bytes_by_direction['unknown'] > 0:
446
 
            msg += ' u:%.0fK)' % (
447
 
                self._bytes_by_direction['unknown'] / 1024.
 
453
            msg += ' u:%.0fkB)' % (
 
454
                self._bytes_by_direction['unknown'] / 1000.
448
455
                )
449
456
        else:
450
457
            msg += ')'