/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: Robert Collins
  • Date: 2009-05-12 06:30:56 UTC
  • mto: This revision was merged to the branch mainline in revision 4593.
  • Revision ID: robertc@robertcollins.net-20090512063056-hdoh46ea7gxqek5c
Add -Dprogress to assist in debugging progress bar jumping.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.lazy_import import lazy_import
27
27
lazy_import(globals(), """
28
28
from bzrlib import (
 
29
    debug,
29
30
    progress,
30
31
    osutils,
31
32
    symbol_versioning,
128
129
        self._last_task = None
129
130
        self._total_byte_count = 0
130
131
        self._bytes_since_update = 0
 
132
        self._fraction = 0
131
133
 
132
134
    def _show_line(self, s):
133
135
        n = self._width - 1
151
153
            cols = 20
152
154
            if self._last_task is None:
153
155
                completion_fraction = 0
 
156
                self._fraction = 0
154
157
            else:
155
158
                completion_fraction = \
156
159
                    self._last_task._overall_completion_fraction() or 0
 
160
            if (completion_fraction < self._fraction and 'progress' in
 
161
                debug.debug_flags):
 
162
                import pdb;pdb.set_trace()
 
163
            self._fraction = completion_fraction
157
164
            markers = int(round(float(cols) * completion_fraction)) - 1
158
165
            bar_str = '[' + ('#' * markers + spin_str).ljust(cols) + '] '
159
166
            return bar_str