~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Aaron Bentley
  • Date: 2007-07-17 13:27:14 UTC
  • mfrom: (2624 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: abentley@panoramicfeedback.com-20070717132714-tmzx9khmg9501k51
Merge from bzr.dev

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
    """
53
58
    isatty = getattr(f, 'isatty', None)
54
59
    if isatty is None:
55
60
        return False
74
79
        if _supports_progress(to_file):
75
80
            return TTYProgressBar(to_file=to_file, **kwargs)
76
81
        else:
77
 
            return DotsProgressBar(to_file=to_file, **kwargs)
 
82
            return DummyProgress(to_file=to_file, **kwargs)
78
83
    else:
79
84
        # Minor sanitation to prevent spurious errors
80
85
        requested_bar_type = requested_bar_type.lower().strip()