aboutsummaryrefslogtreecommitdiff
path: root/tools/patman
diff options
context:
space:
mode:
Diffstat (limited to 'tools/patman')
-rw-r--r--tools/patman/status.py6
-rw-r--r--tools/patman/tools.py8
-rw-r--r--tools/patman/tout.py54
3 files changed, 34 insertions, 34 deletions
diff --git a/tools/patman/status.py b/tools/patman/status.py
index f3fbc661b2..ece6b159d2 100644
--- a/tools/patman/status.py
+++ b/tools/patman/status.py
@@ -245,7 +245,7 @@ def collect_patches(series, series_id, url, rest_api=call_rest_api):
count = len(patch_dict)
num_commits = len(series.commits)
if count != num_commits:
- tout.Warning('Warning: Patchwork reports %d patches, series has %d' %
+ tout.warning('Warning: Patchwork reports %d patches, series has %d' %
(count, num_commits))
patches = []
@@ -257,7 +257,7 @@ def collect_patches(series, series_id, url, rest_api=call_rest_api):
patch.parse_subject(pw_patch['name'])
patches.append(patch)
if warn_count > 1:
- tout.Warning(' (total of %d warnings)' % warn_count)
+ tout.warning(' (total of %d warnings)' % warn_count)
# Sort patches by patch number
patches = sorted(patches, key=lambda x: x.seq)
@@ -437,7 +437,7 @@ def check_patchwork_status(series, series_id, branch, dest_branch, force,
patch_for_commit, _, warnings = compare_with_series(series, patches)
for warn in warnings:
- tout.Warning(warn)
+ tout.warning(warn)
patch_list = [patch_for_commit.get(c) for c in range(len(series.commits))]
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index 35fade0f72..5e4d4ac05c 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -64,16 +64,16 @@ def prepare_output_dir(dirname, preserve=False):
except OSError as err:
raise CmdError("Cannot make output directory '%s': '%s'" %
(outdir, err.strerror))
- tout.Debug("Using output directory '%s'" % outdir)
+ tout.debug("Using output directory '%s'" % outdir)
else:
outdir = tempfile.mkdtemp(prefix='binman.')
- tout.Debug("Using temporary directory '%s'" % outdir)
+ tout.debug("Using temporary directory '%s'" % outdir)
def _remove_output_dir():
global outdir
shutil.rmtree(outdir)
- tout.Debug("Deleted temporary directory '%s'" % outdir)
+ tout.debug("Deleted temporary directory '%s'" % outdir)
outdir = None
def finalise_output_dir():
@@ -121,7 +121,7 @@ def set_input_dirs(dirname):
global indir
indir = dirname
- tout.Debug("Using input directories %s" % indir)
+ tout.debug("Using input directories %s" % indir)
def get_input_filename(fname, allow_missing=False):
"""Return a filename for use as input.
diff --git a/tools/patman/tout.py b/tools/patman/tout.py
index 33305263d8..7eb555aaae 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,14 +52,14 @@ 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:
@@ -70,7 +70,7 @@ def Progress(msg, warning=False, trailer='...'):
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,7 +80,7 @@ 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)
if level < NOTICE:
@@ -88,7 +88,7 @@ def _Output(level, msg, color=None):
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()