1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 06:38:32 +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 ..corrector import get_corrected_commands
from ..exceptions import EmptyCommand
from ..ui import select_command, confirm_command
from ..ui import select_command
from ..utils import get_alias, get_all_executables
@ -41,7 +41,7 @@ def fix_command(known_args):
corrected_commands = get_corrected_commands(command)
selected_command = select_command(corrected_commands)
if selected_command:
selected_command.run(command)
else:

View File

@ -71,6 +71,7 @@ def confirm_text(corrected_command):
reset=color(colorama.Style.RESET_ALL),
blue=color(colorama.Fore.BLUE)))
def double_confirm_text(confirmation_text):
sys.stderr.write(
(u'{prefix}{clear}{bold}{text}{reset} '
@ -83,7 +84,7 @@ def double_confirm_text(confirmation_text):
green=color(colorama.Fore.GREEN),
red=color(colorama.Fore.RED),
reset=color(colorama.Style.RESET_ALL),
))
))
def debug(msg):

View File

@ -6,7 +6,6 @@ from .exceptions import NoRuleMatched
from .system import get_key
from .utils import get_alias
from . import logs, const
from .types import CorrectedCommand
def read_actions():
@ -98,11 +97,11 @@ def select_command(corrected_commands):
selector.next()
logs.confirm_text(selector.value)
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]
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])
def double_confirm(confirmation_text):
logs.double_confirm_text(confirmation_text)
for action in read_actions():