mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 03:17:44 +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)
|
||||
if exit_code is not None:
|
||||
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