diff --git a/thefuck/logs.py b/thefuck/logs.py index 665f77b0..aab3aca2 100644 --- a/thefuck/logs.py +++ b/thefuck/logs.py @@ -17,6 +17,14 @@ def color(color_): return color_ +def warn(title): + sys.stderr.write(u'{warn}[WARN] {title}{reset}\n'.format( + warn=color(colorama.Back.RED + colorama.Fore.WHITE + + colorama.Style.BRIGHT), + reset=color(colorama.Style.RESET_ALL), + title=title)) + + def exception(title, exc_info): sys.stderr.write( u'{warn}[WARN] {title}:{reset}\n{trace}' diff --git a/thefuck/output_readers/read_log.py b/thefuck/output_readers/read_log.py index ffb8da6e..23d80cbc 100644 --- a/thefuck/output_readers/read_log.py +++ b/thefuck/output_readers/read_log.py @@ -4,10 +4,10 @@ try: from shutil import get_terminal_size except ImportError: from backports.shutil_get_terminal_size import get_terminal_size -from warnings import warn import six import pyte from ..exceptions import ScriptNotInLog +from ..logs import warn from .. import const diff --git a/thefuck/shells/generic.py b/thefuck/shells/generic.py index c3b33e6b..a810d8a7 100644 --- a/thefuck/shells/generic.py +++ b/thefuck/shells/generic.py @@ -3,7 +3,7 @@ import os import shlex import six from collections import namedtuple -from warnings import warn +from ..logs import warn from ..utils import memoize from ..conf import settings from ..system import Path diff --git a/thefuck/utils.py b/thefuck/utils.py index 1de4b63a..ae56b963 100644 --- a/thefuck/utils.py +++ b/thefuck/utils.py @@ -7,7 +7,7 @@ from contextlib import closing from decorator import decorator from difflib import get_close_matches from functools import wraps -from warnings import warn +from .logs import warn from .conf import settings from .system import Path