1
0
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:
Ryan Callahan 2021-04-05 21:04:20 -04:00
parent 9c08227b03
commit 0a87d6aee2
No known key found for this signature in database
GPG Key ID: 1EA116782D6C6338
3 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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} '

View File

@ -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():