clint
clint copied to clipboard
Default on prompt.yn returns True always
https://github.com/kennethreitz/clint/blob/8c3cbe984bc3c966c60f279571a5a128d7c194ae/clint/textui/prompt.py#L48-L49
Shouldn't this take into account the default that's passed in?
With the following code if I just hit enter it will still delete the directory.
if prompt.yn("Are you sure you want to delete {directory}".format(directory=directory), default='n'):
print "Deleting..."
shutil.rmtree(directory)
else:
print "Deletion aborted"
You are right, modify default = 'n', for example, prompt.yn (xxx, default = 'n'), the returned value is still true