~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Martin Pool
  • Date: 2005-07-14 08:03:52 UTC
  • Revision ID: mbp@sourcefrog.net-20050714080352-d8631baf3620057d
- start doing new weave-merge algorithm

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
 
19
 
"""
20
 
Simple text-mode progress indicator.
21
 
 
22
 
Everyone loves ascii art!
 
19
"""Simple text-mode progress indicator.
23
20
 
24
21
To display an indicator, create a ProgressBar object.  Call it,
25
22
passing Progress objects indicating the current state.  When done,
59
56
 
60
57
 
61
58
def _supports_progress(f):
62
 
    return hasattr(f, 'isatty') and f.isatty()
 
59
    if not hasattr(f, 'isatty'):
 
60
        return False
 
61
    if not f.isatty():
 
62
        return False
 
63
    import os
 
64
    if os.environ.get('TERM') == 'dumb':
 
65
        # e.g. emacs compile window
 
66
        return False
 
67
    return True
63
68
 
64
69
 
65
70