diff --git a/jrnl/config.py b/jrnl/config.py index 2b07b14b..100b6f44 100644 --- a/jrnl/config.py +++ b/jrnl/config.py @@ -1,20 +1,18 @@ import logging import os -import sys import colorama from ruamel.yaml import YAML import xdg.BaseDirectory from . import __version__ +from jrnl.output import list_journals +from jrnl.output import print_msg from jrnl.exception import JrnlException from jrnl.messages import Message from jrnl.messages import MsgText from jrnl.messages import MsgType -from .color import ERROR_COLOR -from .color import RESET_COLOR -from .output import list_journals # Constants DEFAULT_CONFIG_NAME = "jrnl.yaml" @@ -146,11 +144,15 @@ def verify_config_colors(config): if upper_color == "NONE": continue if not getattr(colorama.Fore, upper_color, None): - print( - "[{2}ERROR{3}: {0} set to invalid color: {1}]".format( - key, color, ERROR_COLOR, RESET_COLOR - ), - file=sys.stderr, + print_msg( + Message( + MsgText.InvalidColor, + MsgType.NORMAL, + { + "key": key, + "color": color, + }, + ) ) all_valid_colors = False return all_valid_colors diff --git a/jrnl/messages.py b/jrnl/messages.py index 6b3d9b52..2341960e 100644 --- a/jrnl/messages.py +++ b/jrnl/messages.py @@ -167,6 +167,9 @@ class MsgText(Enum): {count} imported to {journal_name} journal """ + # --- Color --- # + InvalidColor = "{key} set to invalid color: {color}" + class Message(NamedTuple): text: MsgText