replace print statements with clibella functions

This commit is contained in:
ulinja
2022-04-21 01:06:29 +02:00
parent 058051f1e9
commit 21ff40f75b
4 changed files with 370 additions and 26 deletions

View File

@@ -4,7 +4,11 @@
import re
from printmsg import pinput
import clibella
p = clibella.Printer()
def prompt_yes_or_no(question, ask_until_valid = False):
""" Prompts the user with the specified yes/no question.
@@ -37,7 +41,7 @@ def prompt_yes_or_no(question, ask_until_valid = False):
regex_no = re.compile(r"^(n)$|^(N)$|^(NO)$|^(No)$|^(no)$")
while(not user_input_is_valid):
user_input = pinput(f"{question} (Yes/No): ")
user_input = p.input(f"{question} (Yes/No): ")
if (regex_yes.match(user_input)):
return True
@@ -45,4 +49,3 @@ def prompt_yes_or_no(question, ask_until_valid = False):
return False
elif (not ask_until_valid):
return None