2022-09-14 16:52:49 -05:00
|
|
|
#% extends "py-script.mk" %#
|
|
|
|
#% block name %#confirm#% endblock %#
|
|
|
|
#% block script %#
|
|
|
|
|
|
|
|
import sys
|
2022-09-16 12:47:21 -05:00
|
|
|
|
2022-09-14 16:52:49 -05:00
|
|
|
##- '$(ansi_py)' -##
|
2022-09-20 17:09:42 -05:00
|
|
|
##- '$(quit_make_py)' -##
|
2022-09-14 16:52:49 -05:00
|
|
|
|
2022-09-16 12:47:21 -05:00
|
|
|
|
2022-09-14 16:52:49 -05:00
|
|
|
def confirm():
|
|
|
|
"""
|
|
|
|
Ask user to enter Y or N (case-insensitive).
|
|
|
|
:return: True if the answer is Y.
|
|
|
|
:rtype: bool
|
|
|
|
"""
|
|
|
|
answer = ""
|
|
|
|
while answer not in ["y", "n"]:
|
|
|
|
answer = input(f"""$(2) {a.b_red}[Y/n]{a.end} """).lower()
|
|
|
|
return answer == "y"
|
|
|
|
|
2022-09-16 12:47:21 -05:00
|
|
|
|
2022-09-14 16:52:49 -05:00
|
|
|
if confirm():
|
2022-09-20 17:09:42 -05:00
|
|
|
sys.exit()
|
2022-09-14 16:52:49 -05:00
|
|
|
else:
|
2022-09-20 17:09:42 -05:00
|
|
|
quit_make()
|
2022-09-14 16:52:49 -05:00
|
|
|
#% endblock %#
|