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

feat: added ability to quit early #126

Merged
merged 10 commits into from
Jun 27, 2024
Merged

feat: added ability to quit early #126

merged 10 commits into from
Jun 27, 2024

Conversation

Henri-ColibrITD
Copy link
Contributor

As mentioned in #90, it would be useful for me to be able to quit before making the choice. This is my proposition on how to do it

@aisk
Copy link
Owner

aisk commented May 10, 2024

Hi, please avoid formatting codes you don't touch. If you want to format the code, a new PR is welcome.

@Henri-ColibrITD
Copy link
Contributor Author

Oh right, my bad, I'm too used to have my auto formatter always on, this should be reverted!

src/pick/__init__.py Outdated Show resolved Hide resolved
@aisk
Copy link
Owner

aisk commented May 12, 2024

I have a concern that the current user doesn't have the codes to handle the result of (None, -1), and this could crash their process.

Can we simply add an optional parameter to the pick function, allowing the user to pass a list of keys, such as KEYS_QUIT, with the default value being None? In this way, the code will retain its original behavior if users don't pass this argument.

What's your opinion on this?

@Henri-ColibrITD
Copy link
Contributor Author

What's your opinion on this?

I like the idea. I wanted to avoid affecting the signature as much as possible, but I think a default option serves this role perfectly

@Henri-ColibrITD Henri-ColibrITD marked this pull request as draft May 12, 2024 18:03
@Henri-ColibrITD Henri-ColibrITD marked this pull request as ready for review June 18, 2024 11:29
src/pick/__init__.py Outdated Show resolved Hide resolved
@aisk
Copy link
Owner

aisk commented Jun 22, 2024

Except for the minor review comment, this change looks good to me. However, an update for the README.md in the Options section and a simple example in basic.py would be more appreciated. Could you please add these changes to this PR? @Henri-ColibrITD

README.md Outdated Show resolved Hide resolved
@aisk aisk merged commit 9178897 into aisk:master Jun 27, 2024
15 checks passed
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.

None yet

2 participants