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

Unified Diff: third_party/repo/progress.py

Issue 227163002: Revamped terminal output for update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: rebase Created 6 years, 8 months 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 | « tests/gclient_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/repo/progress.py
diff --git a/third_party/repo/progress.py b/third_party/repo/progress.py
index 3d302814c2c6b175c2966d5db82b6666539d9370..b21e1bc6f0dedf5a5ec8981aa14d8349729c98c4 100644
--- a/third_party/repo/progress.py
+++ b/third_party/repo/progress.py
@@ -59,15 +59,17 @@ class Progress(object):
return
if self._total <= 0:
- sys.stdout.write('%s: %d, done.\n' % (
+ text = '%s: %d, done.' % (
self._title,
- self._done))
- sys.stdout.flush()
+ self._done)
else:
p = (100 * self._done) / self._total
- sys.stdout.write('%s: %3d%% (%d/%d), done.\n' % (
+ text = '%s: %3d%% (%d/%d), done.' % (
self._title,
p,
self._done,
- self._total))
- sys.stdout.flush()
+ self._total)
+
+ spaces = max(self._width - len(text), 0)
+ sys.stdout.write('%s%*s\n' % (text, spaces, ''))
+ sys.stdout.flush()
« no previous file with comments | « tests/gclient_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698