Skip to content

Commit b6d9c82

Browse files
committed
Rename config_color -> colors_enabled
1 parent 9fa2038 commit b6d9c82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cli_ui/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def __repr__(self) -> str:
154154
return f"Symbol({self.as_string})"
155155

156156

157-
def config_color(fileobj: FileObj) -> bool:
157+
def colors_enabled(fileobj: FileObj) -> bool:
158158
if CONFIG["color"] == "never":
159159
return False
160160
if CONFIG["color"] == "always":
@@ -168,7 +168,7 @@ def config_color(fileobj: FileObj) -> bool:
168168

169169

170170
def write_title_string(mystr: str, fileobj: FileObj) -> None:
171-
if not config_color(fileobj):
171+
if not colors_enabled(fileobj):
172172
return
173173
mystr = "\x1b]0;%s\x07" % mystr
174174
fileobj.write(mystr)
@@ -243,7 +243,7 @@ def message(
243243
""" Helper method for error, warning, info, debug
244244
245245
"""
246-
should_use_colors = config_color(fileobj)
246+
should_use_colors = colors_enabled(fileobj)
247247
with_color, without_color = process_tokens(tokens, end=end, sep=sep)
248248
if CONFIG["record"]:
249249
_MESSAGES.append(without_color)
@@ -411,7 +411,7 @@ def info_table(
411411
plain_row.append(plain_str)
412412
colored_data.append(colored_row)
413413
plain_data.append(plain_row)
414-
if config_color(fileobj):
414+
if colors_enabled(fileobj):
415415
data_for_tabulate = colored_data
416416
else:
417417
data_for_tabulate = plain_data

0 commit comments

Comments
 (0)