mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
make linter happy
This commit is contained in:
parent
9c08227b03
commit
0a87d6aee2
@ -6,7 +6,7 @@ from .. import logs, types, const
|
|||||||
from ..conf import settings
|
from ..conf import settings
|
||||||
from ..corrector import get_corrected_commands
|
from ..corrector import get_corrected_commands
|
||||||
from ..exceptions import EmptyCommand
|
from ..exceptions import EmptyCommand
|
||||||
from ..ui import select_command, confirm_command
|
from ..ui import select_command
|
||||||
from ..utils import get_alias, get_all_executables
|
from ..utils import get_alias, get_all_executables
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ def confirm_text(corrected_command):
|
|||||||
reset=color(colorama.Style.RESET_ALL),
|
reset=color(colorama.Style.RESET_ALL),
|
||||||
blue=color(colorama.Fore.BLUE)))
|
blue=color(colorama.Fore.BLUE)))
|
||||||
|
|
||||||
|
|
||||||
def double_confirm_text(confirmation_text):
|
def double_confirm_text(confirmation_text):
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
(u'{prefix}{clear}{bold}{text}{reset} '
|
(u'{prefix}{clear}{bold}{text}{reset} '
|
||||||
@ -83,7 +84,7 @@ def double_confirm_text(confirmation_text):
|
|||||||
green=color(colorama.Fore.GREEN),
|
green=color(colorama.Fore.GREEN),
|
||||||
red=color(colorama.Fore.RED),
|
red=color(colorama.Fore.RED),
|
||||||
reset=color(colorama.Style.RESET_ALL),
|
reset=color(colorama.Style.RESET_ALL),
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
def debug(msg):
|
def debug(msg):
|
||||||
|
@ -6,7 +6,6 @@ from .exceptions import NoRuleMatched
|
|||||||
from .system import get_key
|
from .system import get_key
|
||||||
from .utils import get_alias
|
from .utils import get_alias
|
||||||
from . import logs, const
|
from . import logs, const
|
||||||
from .types import CorrectedCommand
|
|
||||||
|
|
||||||
|
|
||||||
def read_actions():
|
def read_actions():
|
||||||
@ -98,11 +97,11 @@ def select_command(corrected_commands):
|
|||||||
selector.next()
|
selector.next()
|
||||||
logs.confirm_text(selector.value)
|
logs.confirm_text(selector.value)
|
||||||
|
|
||||||
|
if settings.require_double_confirmation and selector.value.script in const.DOUBLE_CONFIRMATION_SCRIPTS:
|
||||||
|
selector.value = double_confirm(const.DOUBLE_CONFIRMATION_SCRIPTS[selector.value.script])
|
||||||
|
|
||||||
if not (settings.require_double_confirmation and selector.value.script in const.DOUBLE_CONFIRMATION_SCRIPTS):
|
|
||||||
return selector.value
|
|
||||||
|
|
||||||
confirmation_text = const.DOUBLE_CONFIRMATION_SCRIPTS[selector.value.script]
|
def double_confirm(confirmation_text):
|
||||||
logs.double_confirm_text(confirmation_text)
|
logs.double_confirm_text(confirmation_text)
|
||||||
|
|
||||||
for action in read_actions():
|
for action in read_actions():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user