mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-22 04:40:42 +00:00
use colorama light colors instead of bright style
This commit is contained in:
parent
ddbe38dee0
commit
258f1a21f0
@ -158,25 +158,25 @@ def _get_critical_handler(json=False):
|
||||
|
||||
def critical(message):
|
||||
"""Format critical messages and return string."""
|
||||
return color_text(colorama.Fore.RED, message)
|
||||
return color_text(colorama.Fore.RED, colorama.Fore.LIGHTRED_EX, message)
|
||||
|
||||
|
||||
def error(message):
|
||||
"""Format error messages and return string."""
|
||||
return color_text(colorama.Fore.RED, message)
|
||||
return color_text(colorama.Fore.RED, colorama.Fore.LIGHTRED_EX, message)
|
||||
|
||||
|
||||
def warn(message):
|
||||
"""Format warn messages and return string."""
|
||||
return color_text(colorama.Fore.YELLOW, message)
|
||||
return color_text(colorama.Fore.YELLOW, colorama.Fore.LIGHTYELLOW_EX, message)
|
||||
|
||||
|
||||
def info(message):
|
||||
"""Format info messages and return string."""
|
||||
return color_text(colorama.Fore.BLUE, message)
|
||||
return color_text(colorama.Fore.BLUE, colorama.Fore.LIGHTBLUE_EX, message)
|
||||
|
||||
|
||||
def color_text(color, msg):
|
||||
def color_text(color, light, msg):
|
||||
"""
|
||||
Colorize strings.
|
||||
|
||||
@ -185,5 +185,5 @@ def color_text(color, msg):
|
||||
:returns: string
|
||||
|
||||
"""
|
||||
msg = msg.format(colorama.Style.BRIGHT)
|
||||
msg = msg.format(light)
|
||||
return "{}{}{}".format(color, msg, colorama.Style.RESET_ALL)
|
||||
|
@ -23,7 +23,7 @@ def test_critical(capsys, mocker):
|
||||
|
||||
print(
|
||||
"{}CRITICAL: {}foo\n{}".format(
|
||||
colorama.Fore.RED, colorama.Style.BRIGHT, colorama.Style.RESET_ALL
|
||||
colorama.Fore.RED, colorama.Fore.LIGHTRED_EX, colorama.Style.RESET_ALL
|
||||
)
|
||||
)
|
||||
x, _ = capsys.readouterr()
|
||||
@ -38,7 +38,7 @@ def test_error(capsys, mocker):
|
||||
|
||||
print(
|
||||
"{}ERROR: {}foo\n{}".format(
|
||||
colorama.Fore.RED, colorama.Style.BRIGHT, colorama.Style.RESET_ALL
|
||||
colorama.Fore.RED, colorama.Fore.LIGHTRED_EX, colorama.Style.RESET_ALL
|
||||
)
|
||||
)
|
||||
x, _ = capsys.readouterr()
|
||||
@ -53,7 +53,7 @@ def test_warn(capsys, mocker):
|
||||
|
||||
print(
|
||||
"{}WARNING: {}foo\n{}".format(
|
||||
colorama.Fore.YELLOW, colorama.Style.BRIGHT, colorama.Style.RESET_ALL
|
||||
colorama.Fore.YELLOW, colorama.Fore.LIGHTYELLOW_EX, colorama.Style.RESET_ALL
|
||||
)
|
||||
)
|
||||
x, _ = capsys.readouterr()
|
||||
@ -68,7 +68,7 @@ def test_info(capsys, mocker):
|
||||
|
||||
print(
|
||||
"{}INFO: {}foo\n{}".format(
|
||||
colorama.Fore.BLUE, colorama.Style.BRIGHT, colorama.Style.RESET_ALL
|
||||
colorama.Fore.BLUE, colorama.Fore.LIGHTBLUE_EX, colorama.Style.RESET_ALL
|
||||
)
|
||||
)
|
||||
x, _ = capsys.readouterr()
|
@ -1,3 +1,5 @@
|
||||
"""Test settings module."""
|
||||
|
||||
import pytest
|
||||
|
||||
from ansiblelater import settings
|
Loading…
Reference in New Issue
Block a user