mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Merge pull request #289 from YunoHost/actions/black
Format Python code with Black
This commit is contained in:
commit
10cb1ebefe
1 changed files with 14 additions and 4 deletions
|
@ -525,7 +525,15 @@ class Interface:
|
||||||
credentials = self.prompt(msg, True, False, color="yellow")
|
credentials = self.prompt(msg, True, False, color="yellow")
|
||||||
return authenticator.authenticate_credentials(credentials=credentials)
|
return authenticator.authenticate_credentials(credentials=credentials)
|
||||||
|
|
||||||
def prompt(self, message, is_password=False, confirm=False, color="blue", prefill="", is_multiline=False):
|
def prompt(
|
||||||
|
self,
|
||||||
|
message,
|
||||||
|
is_password=False,
|
||||||
|
confirm=False,
|
||||||
|
color="blue",
|
||||||
|
prefill="",
|
||||||
|
is_multiline=False,
|
||||||
|
):
|
||||||
"""Prompt for a value
|
"""Prompt for a value
|
||||||
|
|
||||||
Keyword arguments:
|
Keyword arguments:
|
||||||
|
@ -550,14 +558,16 @@ class Interface:
|
||||||
return value
|
return value
|
||||||
else:
|
else:
|
||||||
while True:
|
while True:
|
||||||
value = input(colorize(m18n.g("edit_text_question", message), color))
|
value = input(
|
||||||
|
colorize(m18n.g("edit_text_question", message), color)
|
||||||
|
)
|
||||||
value = value.lower().strip()
|
value = value.lower().strip()
|
||||||
if value in ["", "n", "no"]:
|
if value in ["", "n", "no"]:
|
||||||
return prefill
|
return prefill
|
||||||
elif value in ['y', 'yes']:
|
elif value in ["y", "yes"]:
|
||||||
break
|
break
|
||||||
|
|
||||||
initial_message = prefill.encode('utf-8')
|
initial_message = prefill.encode("utf-8")
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile(suffix=".tmp") as tf:
|
with tempfile.NamedTemporaryFile(suffix=".tmp") as tf:
|
||||||
tf.write(initial_message)
|
tf.write(initial_message)
|
||||||
|
|
Loading…
Reference in a new issue