summaryrefslogtreecommitdiff
path: root/tools/patman/tout.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-10-10 13:35:17 -0400
committerTom Rini <trini@konsulko.com>2018-10-10 13:35:17 -0400
commit3d5ced9e22d32112a20f9dc0f5fb1f22ef088079 (patch)
tree2c1e1f34c4dad05dfd08bd3687e6aee634c58500 /tools/patman/tout.py
parent98068b3be51a77d8b931a2f5097b5c22c57bcea5 (diff)
parent41b781ddf1869f5349e05ace888979f3673fe8c6 (diff)
Merge tag 'dm-9oct18' of git://git.denx.de/u-boot-dm
Test improvements to tidy up output and drop duplicate tests Sandbox SPL/TPL support Various dm-related improvements
Diffstat (limited to 'tools/patman/tout.py')
-rw-r--r--tools/patman/tout.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/patman/tout.py b/tools/patman/tout.py
index 4cd49e1c685..4957c7ae1df 100644
--- a/tools/patman/tout.py
+++ b/tools/patman/tout.py
@@ -15,6 +15,8 @@ NOTICE = 2
INFO = 3
DEBUG = 4
+in_progress = False
+
"""
This class handles output of progress and other useful information
to the user. It provides for simple verbosity level control and can
@@ -48,9 +50,11 @@ def UserIsPresent():
def ClearProgress():
"""Clear any active progress message on the terminal."""
- if verbose > 0 and stdout_is_tty:
+ global in_progress
+ if verbose > 0 and stdout_is_tty and in_progress:
_stdout.write('\r%s\r' % (" " * len (_progress)))
_stdout.flush()
+ in_progress = False
def Progress(msg, warning=False, trailer='...'):
"""Display progress information.
@@ -58,6 +62,7 @@ def Progress(msg, warning=False, trailer='...'):
Args:
msg: Message to display.
warning: True if this is a warning."""
+ global in_progress
ClearProgress()
if verbose > 0:
_progress = msg + trailer
@@ -65,6 +70,7 @@ def Progress(msg, warning=False, trailer='...'):
col = _color.YELLOW if warning else _color.GREEN
_stdout.write('\r' + _color.Color(col, _progress))
_stdout.flush()
+ in_progress = True
else:
_stdout.write(_progress + '\n')