Merge pull request #3405 from andreastt/ato/mach_dumb_term

Support dumb terminals in bootstrap downloads
This commit is contained in:
Simon Sapin 2014-09-18 15:19:25 +01:00
commit 8ec41f2546

View file

@ -47,8 +47,11 @@ def download(desc, src, dst):
print("\rDownloading %s: %5.1f%%" % (desc, pct), end="") print("\rDownloading %s: %5.1f%%" % (desc, pct), end="")
sys.stdout.flush() sys.stdout.flush()
urllib.urlretrieve(src, dst, report) print("Downloading %s..." % desc)
print() 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): def extract(src, dst, movedir=None):
tarfile.open(src).extractall(dst) tarfile.open(src).extractall(dst)