~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Aaron Bentley
  • Date: 2007-12-30 18:20:15 UTC
  • mto: This revision was merged to the branch mainline in revision 3167.
  • Revision ID: aaron.bentley@utoronto.ca-20071230182015-wnqwi7okgkuu6asy
InterDifferingSerializer shows a progress bar

Show diffs side-by-side

added added

removed removed

Lines of Context:
491
491
    def note(self, *args, **kwargs):
492
492
        self.parent.note(*args, **kwargs)
493
493
 
494
 
 
 
494
 
 
495
class InstrumentedProgress(TTYProgressBar):
 
496
    """TTYProgress variant that tracks outcomes"""
 
497
 
 
498
    def __init__(self, *args, **kwargs):
 
499
        self.always_throttled = True
 
500
        self.never_throttle = False
 
501
        TTYProgressBar.__init__(self, *args, **kwargs)
 
502
 
 
503
    def throttle(self, old_message):
 
504
        if self.never_throttle:
 
505
            result =  False
 
506
        else:
 
507
            result = TTYProgressBar.throttle(self, old_message)
 
508
        if result is False:
 
509
            self.always_throttled = False
 
510
 
 
511
 
495
512
def str_tdelta(delt):
496
513
    if delt is None:
497
514
        return "-:--:--"