diff options
author | Simon Glass <sjg@chromium.org> | 2022-01-29 14:14:17 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-02-09 12:30:13 -0700 |
commit | 252ac589969acbc4c17379a4e862a18e1518d12d (patch) | |
tree | c17e36e0f9590e6de59f812066e6649c22be0000 /tools/binman | |
parent | 82e0e732ee2cf6d0e125aeb7ed7de69711f35ec8 (diff) | |
download | u-boot-252ac589969acbc4c17379a4e862a18e1518d12d.tar.gz |
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/binman')
-rw-r--r-- | tools/binman/bintool.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/binman/bintool.py b/tools/binman/bintool.py index 4bc3cfebce..8435b29749 100644 --- a/tools/binman/bintool.py +++ b/tools/binman/bintool.py @@ -174,7 +174,7 @@ class Bintool: res = self.fetch(meth) except urllib.error.URLError as uerr: message = uerr.reason - print(col.Color(col.RED, f'- {message}')) + print(col.build(col.RED, f'- {message}')) except ValueError as exc: print(f'Exception: {exc}') @@ -182,7 +182,7 @@ class Bintool: if skip_present and self.is_present(): return PRESENT - print(col.Color(col.YELLOW, 'Fetch: %s' % self.name)) + print(col.build(col.YELLOW, 'Fetch: %s' % self.name)) if method == FETCH_ANY: for try_method in range(1, FETCH_COUNT): print(f'- trying method: {FETCH_NAMES[try_method]}') @@ -216,7 +216,7 @@ class Bintool: True on success, False on failure """ def show_status(color, prompt, names): - print(col.Color( + print(col.build( color, f'{prompt}:%s{len(names):2}: %s' % (' ' * (16 - len(prompt)), ' '.join(names)))) @@ -227,7 +227,7 @@ class Bintool: name_list = Bintool.get_tool_list() if names_to_fetch[0] == 'missing': skip_present = True - print(col.Color(col.YELLOW, + print(col.build(col.YELLOW, 'Fetching tools: %s' % ' '.join(name_list))) status = collections.defaultdict(list) for name in name_list: |