mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 12:06:04 +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_
|
||||
|
||||
|
||||
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}'
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user