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() |