[Pkg-bazaar-commits] ./bzr/unstable r695: - don't display progress bars on really dumb terminals

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:20:45 UTC 2009


------------------------------------------------------------
revno: 695
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Fri 2005-06-17 17:34:04 +1000
message:
  - don't display progress bars on really dumb terminals
modified:
  bzrlib/progress.py
-------------- next part --------------
=== modified file 'bzrlib/progress.py'
--- a/bzrlib/progress.py	2005-06-14 23:04:26 +0000
+++ b/bzrlib/progress.py	2005-06-17 07:34:04 +0000
@@ -59,7 +59,15 @@
 
 
 def _supports_progress(f):
-    return hasattr(f, 'isatty') and f.isatty()
+    if not hasattr(f, 'isatty'):
+        return False
+    if not f.isatty():
+        return False
+    import os
+    if os.environ.get('TERM') == 'dumb':
+        # e.g. emacs compile window
+        return False
+    return True
 
 
 



More information about the Pkg-bazaar-commits mailing list