Navigation Menu

Skip to content

Commit

Permalink
Support dumb terminals in bootstrap downloads
Browse files Browse the repository at this point in the history
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
  • Loading branch information
andreastt committed Sep 18, 2014
1 parent 340ebdf commit a5b5d35
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/servo/bootstrap_commands.py
Expand Up @@ -47,8 +47,11 @@ def report(count, bsize, fsize):
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)
Expand Down

0 comments on commit a5b5d35

Please sign in to comment.