/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Martin Pool
  • Date: 2009-07-17 10:38:41 UTC
  • mfrom: (4536 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4558.
  • Revision ID: mbp@sourcefrog.net-20090717103841-z35onk04bkiw7zb6
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
        # true when there's output on the screen we may need to clear
209
209
        self._have_output = False
210
210
        # XXX: We could listen for SIGWINCH and update the terminal width...
 
211
        # https://launchpad.net/bugs/316357
211
212
        self._width = osutils.terminal_width()
212
213
        self._last_transport_msg = ''
213
214
        self._spin_pos = 0
315
316
        # XXX: Probably there should be a transport activity model, and that
316
317
        # too should be seen by the progress view, rather than being poked in
317
318
        # here.
 
319
        if not self._have_output:
 
320
            # As a workaround for <https://launchpad.net/bugs/321935> we only
 
321
            # show transport activity when there's already a progress bar
 
322
            # shown, which time the application code is expected to know to
 
323
            # clear off the progress bar when it's going to send some other
 
324
            # output.  Eventually it would be nice to have that automatically
 
325
            # synchronized.
 
326
            return
318
327
        self._total_byte_count += byte_count
319
328
        self._bytes_since_update += byte_count
320
329
        now = time.time()
324
333
            # guard against clock stepping backwards, and don't update too
325
334
            # often
326
335
            rate = self._bytes_since_update / (now - self._transport_update_time)
327
 
            scheme = getattr(transport, '_scheme', None) or repr(transport)
328
 
            if direction == 'read':
329
 
                dir_char = '>'
330
 
            elif direction == 'write':
331
 
                dir_char = '<'
332
 
            else:
333
 
                dir_char = ' '
334
 
            msg = ("%.7s %s %6dKB %5dKB/s" %
335
 
                    (scheme, dir_char, self._total_byte_count>>10, int(rate)>>10,))
 
336
            msg = ("%6dKB %5dKB/s" %
 
337
                    (self._total_byte_count>>10, int(rate)>>10,))
336
338
            self._transport_update_time = now
337
339
            self._last_repaint = now
338
340
            self._bytes_since_update = 0