~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to progress.py

  • Committer: Aaron Bentley
  • Date: 2005-07-25 14:17:15 UTC
  • Revision ID: abentley@panoramicfeedback.com-20050725141715-d410836f6e4a32c0
Got baz2bzr/annotate working now that ProgressBar is a function

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import sys
19
19
import datetime
20
 
from bzrlib import progress
 
20
from bzrlib.progress import ProgressBar
21
21
 
22
22
class Progress(object):
23
23
    def __init__(self, units, current, total=None):
39
39
        else:
40
40
            return "%i %s" (self.current, self.units) 
41
41
 
42
 
class ProgressBar(progress.ProgressBar):
43
 
    def __init__(self):
44
 
        progress.ProgressBar.__init__(self)
45
 
 
46
 
    def __call__(self, prog):
47
 
        self.update(prog.units, prog.current, prog.total)
 
42
def show_progress(pi, prog):
 
43
    pi.update(prog.units, prog.current, prog.total)
48
44
        
49
45
def clear_progress_bar():
50
46
    sys.stderr.write('\r%s\r' % (' '*79))