mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 11:24:02 +03:00
util.log: add yes_or_no()
This commit is contained in:
parent
251b80962a
commit
f94c8d530d
@ -96,3 +96,9 @@ def wtf(message, exit_code=1):
|
|||||||
print_log(message, RED, BOLD)
|
print_log(message, RED, BOLD)
|
||||||
if exit_code is not None:
|
if exit_code is not None:
|
||||||
sys.exit(exit_code)
|
sys.exit(exit_code)
|
||||||
|
|
||||||
|
def yes_or_no(message):
|
||||||
|
ans = str(input('%s (y/N) ' % message)).lower().strip()
|
||||||
|
if ans == 'y':
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user