updated prompt_continue, so it now gives the option of either exiting on failure or returning a true/false value
This commit is contained in:
parent
39d6514eda
commit
6b3d4be580
1 changed files with 7 additions and 2 deletions
|
|
@ -379,7 +379,8 @@ def link_create(path_src, path_dst, debug=False):
|
||||||
return msg_debug
|
return msg_debug
|
||||||
|
|
||||||
|
|
||||||
def prompt_continue(message="Do you want to continue? Y/n", default="Y"):
|
def prompt_continue(message="Do you want to continue? Y/n", default="Y",
|
||||||
|
exit=True):
|
||||||
""" prompts user if he wants to continue
|
""" prompts user if he wants to continue
|
||||||
|
|
||||||
Keyword Arguments:
|
Keyword Arguments:
|
||||||
|
|
@ -399,9 +400,13 @@ def prompt_continue(message="Do you want to continue? Y/n", default="Y"):
|
||||||
printvar(
|
printvar(
|
||||||
"prompt_val", prompt_val,
|
"prompt_val", prompt_val,
|
||||||
not booleanize(prompt_val))
|
not booleanize(prompt_val))
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
if not booleanize(prompt_val):
|
if not booleanize(prompt_val):
|
||||||
sys.exit()
|
if exit:
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def check_debug(env):
|
def check_debug(env):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue