mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 20:11:17 +00:00
#682: Make warnings more visible
This commit is contained in:
parent
5504b905f3
commit
9cb04ac631
@ -17,6 +17,14 @@ def color(color_):
|
|||||||
return 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):
|
def exception(title, exc_info):
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
u'{warn}[WARN] {title}:{reset}\n{trace}'
|
u'{warn}[WARN] {title}:{reset}\n{trace}'
|
||||||
|
@ -4,10 +4,10 @@ try:
|
|||||||
from shutil import get_terminal_size
|
from shutil import get_terminal_size
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from backports.shutil_get_terminal_size import get_terminal_size
|
from backports.shutil_get_terminal_size import get_terminal_size
|
||||||
from warnings import warn
|
|
||||||
import six
|
import six
|
||||||
import pyte
|
import pyte
|
||||||
from ..exceptions import ScriptNotInLog
|
from ..exceptions import ScriptNotInLog
|
||||||
|
from ..logs import warn
|
||||||
from .. import const
|
from .. import const
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import os
|
|||||||
import shlex
|
import shlex
|
||||||
import six
|
import six
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from warnings import warn
|
from ..logs import warn
|
||||||
from ..utils import memoize
|
from ..utils import memoize
|
||||||
from ..conf import settings
|
from ..conf import settings
|
||||||
from ..system import Path
|
from ..system import Path
|
||||||
|
@ -7,7 +7,7 @@ from contextlib import closing
|
|||||||
from decorator import decorator
|
from decorator import decorator
|
||||||
from difflib import get_close_matches
|
from difflib import get_close_matches
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from warnings import warn
|
from .logs import warn
|
||||||
from .conf import settings
|
from .conf import settings
|
||||||
from .system import Path
|
from .system import Path
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user