aboutsummaryrefslogtreecommitdiff
path: root/tools/buildman/control.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-01-29 14:14:17 -0700
committerSimon Glass <sjg@chromium.org>2022-02-09 12:30:13 -0700
commit252ac589969acbc4c17379a4e862a18e1518d12d (patch)
treec17e36e0f9590e6de59f812066e6649c22be0000 /tools/buildman/control.py
parent82e0e732ee2cf6d0e125aeb7ed7de69711f35ec8 (diff)
patman: Rename Color() method to build()
This method has the same name as its class which is confusing. It is also annoying when searching the code. It builds a string with a colour, so rename it to build(). Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/control.py')
-rw-r--r--tools/buildman/control.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 0e4b2e0a9d..195d27a044 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -73,7 +73,7 @@ def ShowActions(series, why_selected, boards_selected, builder, options,
if commits:
for upto in range(0, len(series.commits), options.step):
commit = series.commits[upto]
- print(' ', col.Color(col.YELLOW, commit.hash[:8], bright=False), end=' ')
+ print(' ', col.build(col.YELLOW, commit.hash[:8], bright=False), end=' ')
print(commit.subject)
print()
for arg in why_selected:
@@ -85,7 +85,7 @@ def ShowActions(series, why_selected, boards_selected, builder, options,
len(why_selected['all'])))
if board_warnings:
for warning in board_warnings:
- print(col.Color(col.YELLOW, warning))
+ print(col.build(col.YELLOW, warning))
def ShowToolchainPrefix(boards, toolchains):
"""Show information about a the tool chain used by one or more boards
@@ -152,14 +152,14 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
if options.fetch_arch:
if options.fetch_arch == 'list':
sorted_list = toolchains.ListArchs()
- print(col.Color(col.BLUE, 'Available architectures: %s\n' %
+ print(col.build(col.BLUE, 'Available architectures: %s\n' %
' '.join(sorted_list)))
return 0
else:
fetch_arch = options.fetch_arch
if fetch_arch == 'all':
fetch_arch = ','.join(toolchains.ListArchs())
- print(col.Color(col.CYAN, '\nDownloading toolchains: %s' %
+ print(col.build(col.CYAN, '\nDownloading toolchains: %s' %
fetch_arch))
for arch in fetch_arch.split(','):
print()
@@ -177,11 +177,11 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
return 0
if options.incremental:
- print(col.Color(col.RED,
+ print(col.build(col.RED,
'Warning: -I has been removed. See documentation'))
if not options.output_dir:
if options.work_in_output:
- sys.exit(col.Color(col.RED, '-w requires that you specify -o'))
+ sys.exit(col.build(col.RED, '-w requires that you specify -o'))
options.output_dir = '..'
# Work out what subset of the boards we are building
@@ -218,12 +218,12 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
requested_boards)
selected = boards.GetSelected()
if not len(selected):
- sys.exit(col.Color(col.RED, 'No matching boards found'))
+ sys.exit(col.build(col.RED, 'No matching boards found'))
if options.print_prefix:
err = ShowToolchainPrefix(boards, toolchains)
if err:
- sys.exit(col.Color(col.RED, err))
+ sys.exit(col.build(col.RED, err))
return 0
# Work out how many commits to build. We want to build everything on the
@@ -242,24 +242,24 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
count, msg = gitutil.count_commits_in_branch(options.git_dir,
options.branch)
if count is None:
- sys.exit(col.Color(col.RED, msg))
+ sys.exit(col.build(col.RED, msg))
elif count == 0:
- sys.exit(col.Color(col.RED, "Range '%s' has no commits" %
+ sys.exit(col.build(col.RED, "Range '%s' has no commits" %
options.branch))
if msg:
- print(col.Color(col.YELLOW, msg))
+ print(col.build(col.YELLOW, msg))
count += 1 # Build upstream commit also
if not count:
str = ("No commits found to process in branch '%s': "
"set branch's upstream or use -c flag" % options.branch)
- sys.exit(col.Color(col.RED, str))
+ sys.exit(col.build(col.RED, str))
if options.work_in_output:
if len(selected) != 1:
- sys.exit(col.Color(col.RED,
+ sys.exit(col.build(col.RED,
'-w can only be used with a single board'))
if count != 1:
- sys.exit(col.Color(col.RED,
+ sys.exit(col.build(col.RED,
'-w can only be used with a single commit'))
# Read the metadata from the commits. First look at the upstream commit,