~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Martin Pool
  • Date: 2005-06-17 07:34:04 UTC
  • Revision ID: mbp@sourcefrog.net-20050617073404-7c914dc1bd15f38a
- don't display progress bars on really dumb terminals

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
 
60
60
 
61
61
def _supports_progress(f):
62
 
    return hasattr(f, 'isatty') and f.isatty()
 
62
    if not hasattr(f, 'isatty'):
 
63
        return False
 
64
    if not f.isatty():
 
65
        return False
 
66
    import os
 
67
    if os.environ.get('TERM') == 'dumb':
 
68
        # e.g. emacs compile window
 
69
        return False
 
70
    return True
63
71
 
64
72
 
65
73