Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needed choice on python 2.6 #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

bastbnl
Copy link

@bastbnl bastbnl commented Aug 7, 2015

... so I went ahead and created some changes to see that it works on python 2.6 as well. I also replaced the \n in the code to os.linesep, allowing this to work properly on non-Unix systems as well.

I've performed some basic tests (Menu with choices, Menu with choices and actions, Input with int, Binary with default False) but it's probably a good idea to verify that it still works properly on python 2.7 and 3 as well

Thanks for a pretty useful module.

bastbnl added 6 commits August 7, 2015 17:29
Prevents the AttributeError concerning the version dependent code when running on python 2.6
Fixed an exception occuring when pressing 'b' on a Menu with only a list of choices
Example classes are now working on python 2.6 as well
Proposing a new version of the package because I need it. The intention of the c used in the version is to make sure it's considered an older version when the original author creates the real version 0.2
Can now test on python 2.6 too
# Get a yes or no response (default is no)
confirm = choice.Binary('Are you sure you want to delete?', False).ask()
if confirm:
deleteIt()
c()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bastbnl, any reason to put this in a separate c() function rather than just inline? Seems to me that just writing print("Delete confirmed") here would work too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason. I noticed confirming the question stops the test script as the function is undefined. A separate function is not required at all and printing a message would make sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants