aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorAndreas Tolfsen <ato@mozilla.com>2014-09-18 12:16:49 +0100
committerAndreas Tolfsen <ato@mozilla.com>2014-09-18 12:16:49 +0100
commita5b5d358fbeed00b43d3c83c4beb926b339f9727 (patch)
treed4c28b9aa42d753a6be58b7b35d3ec3ed20b1696 /python/servo
parent340ebdfd85f9f9bb3caa352f5c679b4f3b3b9f97 (diff)
downloadservo-a5b5d358fbeed00b43d3c83c4beb926b339f9727.tar.gz
servo-a5b5d358fbeed00b43d3c83c4beb926b339f9727.zip
Support dumb terminals in bootstrap downloads
Dumb terminals can only interpret a limited number of control codes, and rewriting the terminal buffer will make `./mach build` very talkative on these terminals. This can be tested by setting the environment variable TERM to "dumb" as such: TERM=dumb ./mach build
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/bootstrap_commands.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index 13a411f7008..bf83803afac 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -47,8 +47,11 @@ def download(desc, src, dst):
print("\rDownloading %s: %5.1f%%" % (desc, pct), end="")
sys.stdout.flush()
- urllib.urlretrieve(src, dst, report)
- print()
+ print("Downloading %s..." % desc)
+ dumb = os.environ.get("TERM") == "dumb"
+ urllib.urlretrieve(src, dst, None if dumb else report)
+ if not dumb:
+ print()
def extract(src, dst, movedir=None):
tarfile.open(src).extractall(dst)