Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: tools/win/toolchain/toolchain.py

Issue 70493006: Auto-updating script for Windows toolchain (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove DEPS Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/win/toolchain/get_toolchain_if_necessary.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/win/toolchain/toolchain.py
diff --git a/tools/win/toolchain/toolchain.py b/tools/win/toolchain/toolchain.py
index e98fc9b4cf3d089dbee71a22f97d6068498ee4a7..1c16fb1632bfa9ee472f8a6ae11bc6466b9ac1b8 100644
--- a/tools/win/toolchain/toolchain.py
+++ b/tools/win/toolchain/toolchain.py
@@ -57,10 +57,11 @@ def DeleteAllTempDirs():
def Download(url, local_path):
"""Download a large-ish binary file and print some status information while
doing so."""
- sys.stdout.write('Downloading %s...' % url)
+ sys.stdout.write('Downloading %s...\n' % url)
req = urllib2.urlopen(url)
content_length = int(req.headers.get('Content-Length', 0))
bytes_read = 0
+ terminator = '\r' if sys.stdout.isatty() else '\n'
with open(local_path, 'wb') as file:
while True:
chunk = req.read(1024 * 1024)
@@ -68,7 +69,8 @@ def Download(url, local_path):
break
bytes_read += len(chunk)
file.write(chunk)
- sys.stdout.write('.')
+ sys.stdout.write('... %d/%d%s' % (bytes_read, content_length, terminator))
+ sys.stdout.flush()
sys.stdout.write('\n')
if content_length and content_length != bytes_read:
raise SystemExit('Got incorrect number of bytes downloading %s' % url)
@@ -224,6 +226,7 @@ def ExtractIso(iso_path):
.exe)."""
target_path = TempDir()
sys.stdout.write('Extracting %s...\n' % iso_path)
+ sys.stdout.flush()
# TODO(scottmg): Do this (and exe) manually with python code.
# Note that at the beginning of main() we set the working directory to 7z's
# location.
« no previous file with comments | « tools/win/toolchain/get_toolchain_if_necessary.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698