diff options
author | Tom Rini <trini@konsulko.com> | 2022-02-10 09:02:06 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-02-10 09:19:44 -0500 |
commit | 2ccd2bc8c3580e00c51094c5cc2b3e2ead8d35c3 (patch) | |
tree | 4e7349b8831fee4b342a971025273d3cd042a2f9 /tools/patman/tout.py | |
parent | 6662e5e406fdee26ba981dd4af3308f51f254f0a (diff) | |
parent | f3078d4ea707931c2307a623ecf6e4d215b413d5 (diff) |
Merge tag 'dm-pull-8feb22-take3' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
patman snake-case conversion
binman fit improvements
ACPI fixes and making MCFG available to ARM
[trini: Update scripts/pylint.base]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/patman/tout.py')
-rw-r--r-- | tools/patman/tout.py | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/tools/patman/tout.py b/tools/patman/tout.py index 33305263d8e..ff0fd92afcc 100644 --- a/tools/patman/tout.py +++ b/tools/patman/tout.py @@ -30,10 +30,10 @@ def __enter__(): def __exit__(unused1, unused2, unused3): """Clean up and remove any progress message.""" - ClearProgress() + clear_progress() return False -def UserIsPresent(): +def user_is_present(): """This returns True if it is likely that a user is present. Sometimes we want to prompt the user, but if no one is there then this @@ -44,7 +44,7 @@ def UserIsPresent(): """ return stdout_is_tty and verbose > 0 -def ClearProgress(): +def clear_progress(): """Clear any active progress message on the terminal.""" global in_progress if verbose > 0 and stdout_is_tty and in_progress: @@ -52,25 +52,25 @@ def ClearProgress(): _stdout.flush() in_progress = False -def Progress(msg, warning=False, trailer='...'): +def progress(msg, warning=False, trailer='...'): """Display progress information. Args: msg: Message to display. warning: True if this is a warning.""" global in_progress - ClearProgress() + clear_progress() if verbose > 0: _progress = msg + trailer if stdout_is_tty: col = _color.YELLOW if warning else _color.GREEN - _stdout.write('\r' + _color.Color(col, _progress)) + _stdout.write('\r' + _color.build(col, _progress)) _stdout.flush() in_progress = True else: _stdout.write(_progress + '\n') -def _Output(level, msg, color=None): +def _output(level, msg, color=None): """Output a message to the terminal. Args: @@ -80,15 +80,15 @@ def _Output(level, msg, color=None): error: True if this is an error message, else False. """ if verbose >= level: - ClearProgress() + clear_progress() if color: - msg = _color.Color(color, msg) + msg = _color.build(color, msg) if level < NOTICE: print(msg, file=sys.stderr) else: print(msg) -def DoOutput(level, msg): +def do_output(level, msg): """Output a message to the terminal. Args: @@ -96,66 +96,66 @@ def DoOutput(level, msg): this as high as the currently selected level. msg; Message to display. """ - _Output(level, msg) + _output(level, msg) -def Error(msg): +def error(msg): """Display an error message Args: msg; Message to display. """ - _Output(ERROR, msg, _color.RED) + _output(ERROR, msg, _color.RED) -def Warning(msg): +def warning(msg): """Display a warning message Args: msg; Message to display. """ - _Output(WARNING, msg, _color.YELLOW) + _output(WARNING, msg, _color.YELLOW) -def Notice(msg): +def notice(msg): """Display an important infomation message Args: msg; Message to display. """ - _Output(NOTICE, msg) + _output(NOTICE, msg) -def Info(msg): +def info(msg): """Display an infomation message Args: msg; Message to display. """ - _Output(INFO, msg) + _output(INFO, msg) -def Detail(msg): +def detail(msg): """Display a detailed message Args: msg; Message to display. """ - _Output(DETAIL, msg) + _output(DETAIL, msg) -def Debug(msg): +def debug(msg): """Display a debug message Args: msg; Message to display. """ - _Output(DEBUG, msg) + _output(DEBUG, msg) -def UserOutput(msg): +def user_output(msg): """Display a message regardless of the current output level. This is used when the output was specifically requested by the user. Args: msg; Message to display. """ - _Output(0, msg) + _output(0, msg) -def Init(_verbose=WARNING, stdout=sys.stdout): +def init(_verbose=WARNING, stdout=sys.stdout): """Initialize a new output object. Args: @@ -173,7 +173,7 @@ def Init(_verbose=WARNING, stdout=sys.stdout): stdout_is_tty = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty() stderr_is_tty = hasattr(sys.stderr, 'isatty') and sys.stderr.isatty() -def Uninit(): - ClearProgress() +def uninit(): + clear_progress() -Init() +init() |