mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 15:02:51 +03:00
install: echo characters that the user inputs at the prompt
This commit is contained in:
parent
b9b4ca9778
commit
addb7b9acc
1 changed files with 3 additions and 1 deletions
|
@ -295,7 +295,7 @@ def prompt_user(yes, msg):
|
||||||
"""Prompt user for yes/no, supporting Enter and Esc as accepted answers."""
|
"""Prompt user for yes/no, supporting Enter and Esc as accepted answers."""
|
||||||
run_install = yes
|
run_install = yes
|
||||||
if yes is None and sys.stdout.isatty():
|
if yes is None and sys.stdout.isatty():
|
||||||
print(msg, flush=True)
|
print(msg, end=' ', flush=True)
|
||||||
answer = ''
|
answer = ''
|
||||||
while True:
|
while True:
|
||||||
in_char = read_char()
|
in_char = read_char()
|
||||||
|
@ -303,8 +303,10 @@ def prompt_user(yes, msg):
|
||||||
break
|
break
|
||||||
if not in_char.isprintable():
|
if not in_char.isprintable():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
print(in_char, end='', flush=True)
|
||||||
answer += in_char
|
answer += in_char
|
||||||
run_install = strtobool(answer)
|
run_install = strtobool(answer)
|
||||||
|
print()
|
||||||
return run_install
|
return run_install
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue