Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Issue#145 textui.prompt.yn #150

Closed
wants to merge 5 commits into from
Closed

Issue#145 textui.prompt.yn #150

wants to merge 5 commits into from

Conversation

tz70s
Copy link

@tz70s tz70s commented Sep 3, 2015

issue #145
Hello , I'm not sure about what author exactly wanted this function do
However , I try to fixed the boolean return value in textui.prompt.yn()function
I agree issue #145 concerned about the output is more close to users' thoughts
Testing code as issue #145

from clint.textui import prompt

for d in range(3):
    print(prompt.yn("Yes?"))

for y in range(3):
    print(prompt.yn("Yes? default=y", default="y"))

for n in range(3):
    print(prompt.yn("Yes? default=n", default="n"))
  • Before , output changed when no as default section
Yes? default=n [y/N] y
False
Yes? default=n [y/N] n
True
Yes? default=n [y/N]
False
  • After
Yes? default=n [y/N] y
True
Yes? default=n [y/N] n
False
Yes? default=n [y/N] 
False
  • The yn function's return value is now defined as
yes  ->  return True
no   ->  return False
NULL string -> return True if default is 'y' else False

@wkentaro
Copy link
Contributor

wkentaro commented Sep 4, 2015

lgtm. 👍

@wkentaro
Copy link
Contributor

two commits can be squashed?

@tz70s
Copy link
Author

tz70s commented Sep 21, 2015

Sure, I'll do it later

@wkentaro
Copy link
Contributor

maybe you need another rebase.

@tz70s tz70s closed this Sep 22, 2015
@tz70s
Copy link
Author

tz70s commented Sep 22, 2015

Sorry, I got messed on rebase. I can get an another pr if needed.

wkentaro referenced this pull request in wkentaro/clint Sep 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants