~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

fix NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
 
52
52
def _supports_progress(f):
53
 
    """Detect if we can use pretty progress bars on the output stream f.
54
 
 
55
 
    If this returns true we expect that a human may be looking at that 
56
 
    output, and that we can repaint a line to update it.
57
 
    """
58
53
    isatty = getattr(f, 'isatty', None)
59
54
    if isatty is None:
60
55
        return False
79
74
        if _supports_progress(to_file):
80
75
            return TTYProgressBar(to_file=to_file, **kwargs)
81
76
        else:
82
 
            return DummyProgress(to_file=to_file, **kwargs)
 
77
            return DotsProgressBar(to_file=to_file, **kwargs)
83
78
    else:
84
79
        # Minor sanitation to prevent spurious errors
85
80
        requested_bar_type = requested_bar_type.lower().strip()
461
456
 
462
457
    def update(self, msg, current_cnt=None, total_cnt=None):
463
458
        self.current = current_cnt
464
 
        if total_cnt is not None:
465
 
            self.total = total_cnt
 
459
        self.total = total_cnt
466
460
        self.message = msg
467
461
        self.child_fraction = 0
468
462
        self.tick()
549
543
            self.cur_phase = 0
550
544
        else:
551
545
            self.cur_phase += 1
552
 
        assert self.cur_phase < self.total
 
546
        assert self.cur_phase < self.total 
553
547
        self.pb.update(self.message, self.cur_phase, self.total)
554
548
 
555
549