mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Seperate formatting from constraints checking
This commit is contained in:
parent
52514957d1
commit
9c35b770a2
1 changed files with 3 additions and 3 deletions
|
@ -69,17 +69,17 @@ def validating_input(
|
||||||
|
|
||||||
while ans is None or not adj_check_constraints_function(ans):
|
while ans is None or not adj_check_constraints_function(ans):
|
||||||
if not first_run:
|
if not first_run:
|
||||||
print("Invalid input!")
|
print("Invalid input!\n")
|
||||||
else:
|
else:
|
||||||
first_run = False
|
first_run = False
|
||||||
|
|
||||||
ans = input(prompt)
|
ans = input(prompt)
|
||||||
try:
|
try:
|
||||||
ans = format_function(ans)
|
formatted_ans = format_function(ans)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
ans = None
|
ans = None
|
||||||
|
|
||||||
return ans
|
return formatted_ans
|
||||||
|
|
||||||
|
|
||||||
def confirm(prompt):
|
def confirm(prompt):
|
||||||
|
|
Loading…
Reference in a new issue