~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-01-05 04:30:07 UTC
  • mfrom: (4932 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4934.
  • Revision ID: john@arbash-meinel.com-20100105043007-ehgbldqd3q0gtyws
Merge bzr.dev, resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
310
310
            markers = int(round(float(cols) * completion_fraction)) - 1
311
311
            bar_str = '[' + ('#' * markers + spin_str).ljust(cols) + '] '
312
312
            return bar_str
313
 
        elif self._last_task.show_spinner:
 
313
        elif (self._last_task is None) or self._last_task.show_spinner:
314
314
            # The last task wanted just a spinner, no bar
315
315
            spin_str =  r'/-\|'[self._spin_pos % 4]
316
316
            self._spin_pos += 1
378
378
        This may update a progress bar, spinner, or similar display.
379
379
        By default it does nothing.
380
380
        """
381
 
        # XXX: Probably there should be a transport activity model, and that
382
 
        # too should be seen by the progress view, rather than being poked in
383
 
        # here.
 
381
        # XXX: there should be a transport activity model, and that too should
 
382
        #      be seen by the progress view, rather than being poked in here.
384
383
        self._total_byte_count += byte_count
385
384
        self._bytes_since_update += byte_count
386
385
        if self._first_byte_time is None:
392
391
            self._bytes_by_direction[direction] += byte_count
393
392
        else:
394
393
            self._bytes_by_direction['unknown'] += byte_count
395
 
        if not self._have_output:
396
 
            # As a workaround for <https://launchpad.net/bugs/321935> we only
397
 
            # show transport activity when there's already a progress bar
398
 
            # shown, which time the application code is expected to know to
399
 
            # clear off the progress bar when it's going to send some other
400
 
            # output.  Eventually it would be nice to have that automatically
401
 
            # synchronized.
 
394
        if 'no_activity' in debug.debug_flags:
 
395
            # Can be used as a workaround if
 
396
            # <https://launchpad.net/bugs/321935> reappears and transport
 
397
            # activity is cluttering other output.  However, thanks to
 
398
            # TextUIOutputStream this shouldn't be a problem any more.
402
399
            return
403
400
        now = time.time()
404
401
        if self._total_byte_count < 2000: