From 256d2fa27cd13fe5d21af59093a9f7cfa4e2e073 Mon Sep 17 00:00:00 2001 From: Benjamin Poldrack Date: Fri, 14 Oct 2022 09:24:52 +0200 Subject: [PATCH] Don't split prompt and question in CredentialManager In opposition to the `Credential`'s in datalad core, the CredentialManager splits the prompting text and the input retrieval when asking for a property or secret by calling `ui.message` and then `ui.question`. While this is kinda fine with CLI, other `ui` backends like gooey can't handle this properly (leading to https://github.com/datalad/datalad-gooey/issues/340). The `title` parameter of `ui.question` is intended for the prompting text, which is somewhat misleading by name. --- datalad_next/credman.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datalad_next/credman.py b/datalad_next/credman.py index 06a51d81..249af7a0 100644 --- a/datalad_next/credman.py +++ b/datalad_next/credman.py @@ -510,17 +510,17 @@ def _ask_property(self, name, prompt=None): if not ui.is_interactive: lgr.debug('Cannot ask for credential property %r in non-interactive session', name) return - self._prompt(prompt) - return ui.question(name, title=None) + + return ui.question(name, title=prompt) def _ask_secret(self, type_hint=None, prompt=None): if not ui.is_interactive: lgr.debug('Cannot ask for credential secret in non-interactive session') return - self._prompt(prompt) + return ui.question( type_hint or 'secret', - title=None, + title=prompt, repeat=self._cfg.obtain( 'datalad.credentials.repeat-secret-entry'), hidden=self._cfg.obtain(