From fc987ea9c0ca80bd8ca20d19b351ce2980e56ef7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 15 Dec 2017 14:49:49 +0100 Subject: [PATCH] Make message.confirm_async keyword-only --- qutebrowser/browser/history.py | 4 ++-- qutebrowser/utils/message.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py index 3b4b0e362..ecab730ae 100644 --- a/qutebrowser/browser/history.py +++ b/qutebrowser/browser/history.py @@ -149,8 +149,8 @@ class WebHistory(sql.SqlTable): if force: self._do_clear() else: - message.confirm_async(self._do_clear, title="Clear all browsing " - "history?") + message.confirm_async(yes_action=self._do_clear, + title="Clear all browsing history?") def _do_clear(self): with self._handle_sql_errors(): diff --git a/qutebrowser/utils/message.py b/qutebrowser/utils/message.py index 6957f115d..32395b8bd 100644 --- a/qutebrowser/utils/message.py +++ b/qutebrowser/utils/message.py @@ -137,8 +137,8 @@ def ask_async(title, mode, handler, **kwargs): global_bridge.ask(question, blocking=False) -def confirm_async(yes_action, no_action=None, cancel_action=None, - *args, **kwargs): +def confirm_async(*, yes_action, no_action=None, cancel_action=None, + **kwargs): """Ask a yes/no question to the user and execute the given actions. Args: @@ -154,7 +154,7 @@ def confirm_async(yes_action, no_action=None, cancel_action=None, The question object. """ kwargs['mode'] = usertypes.PromptMode.yesno - question = _build_question(*args, **kwargs) # pylint: disable=missing-kwoa + question = _build_question(**kwargs) # pylint: disable=missing-kwoa question.answered_yes.connect(yes_action) if no_action is not None: question.answered_no.connect(no_action)