mirror of https://github.com/cheat/cheat.git
Merge pull request #288 from rski/remove_prompt_function
Remove prompt_yes_or_no
This commit is contained in:
commit
3494827403
|
@ -46,20 +46,6 @@ def editor():
|
||||||
return os.environ['EDITOR']
|
return os.environ['EDITOR']
|
||||||
|
|
||||||
|
|
||||||
def prompt_yes_or_no(question):
|
|
||||||
""" Prompts the user with a yes-or-no question """
|
|
||||||
# Support Python 2 and 3 input
|
|
||||||
# Default to Python 2's input()
|
|
||||||
get_input = raw_input
|
|
||||||
|
|
||||||
# If this is Python 3, use input()
|
|
||||||
if sys.version_info[:2] >= (3, 0):
|
|
||||||
get_input = input
|
|
||||||
|
|
||||||
print(question)
|
|
||||||
return get_input('[y/n] ') == 'y'
|
|
||||||
|
|
||||||
|
|
||||||
def warn(message):
|
def warn(message):
|
||||||
""" Prints a message to stderr """
|
""" Prints a message to stderr """
|
||||||
print((message), file=sys.stderr)
|
print((message), file=sys.stderr)
|
||||||
|
|
Loading…
Reference in New Issue