~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: mbp at sourcefrog
  • Date: 2007-01-12 03:52:12 UTC
  • mto: (2230.1.1 short-options)
  • mto: This revision was merged to the branch mainline in revision 2231.
  • Revision ID: mbp@sourcefrog.net-20070112035212-rgjqu83owh9s5s2p
add test that legacy SHORT_OPTIONS really works, and set_short_name

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()