markfink / whaaaaat

Inquirer.js port to Python (https://www.npmjs.com/package/inquirer). people blame me for staling this project. I do not have time to work on this right now - whaaaaat do you want me to do? take it offline?
MIT License
83 stars 9 forks source link

Add Python 3 compatibility #2

Closed lelit closed 7 years ago

lelit commented 7 years ago

This set of commits do tiny cleanups and then make the library usable under Python 3, at least as far as automatic tests can tell.

markfink commented 7 years ago

wow. that is really cool! I was planning to add python3 support myself but did not find the time yet. whaaaaat is pretty new. are you using it in your projects where you need python3 support? I can not look into this pull request today but I promise do do so asap.

lelit commented 7 years ago

Not yet, but if/when this is accepted, I will try to switch my tinject tool from inquirer to wha+t, should not be hard.

markfink commented 7 years ago

@lelit a fine piece of work. thank you so much!

lelit commented 7 years ago

You're welcome! Unfortunately, it seems that I didn't spot all the places: common.py needs the

import sys
...
PY3 = sys.version_info[0] >= 3

if PY3:
    basestring = str

snippet too.

lelit commented 7 years ago

I may submit another PR for this if you prefer, but I think the best would be to create a test covering setup_validator and setup_simple_validator too. Let me know and I will try to do that as well.

markfink commented 7 years ago

you are absolutely right, the test coverage is not where I want it to be. If you like to contribute the test please go ahead. please be aware that ptk 2.0 is coming: https://github.com/jonathanslenders/python-prompt-toolkit/pull/446 this plays into our direction by providing dialogs but might also cause some rework in whaaaaat