Skip to content

Conversation

@sampsyo
Copy link

@sampsyo sampsyo commented May 13, 2024

Hello! Thanks for this very useful timer!

I've been using this to display the time remaining in exams for my class this semester. It worked great for both of the preliminary exams because the duration was 50 minutes. But the final exam, which is happening now, is 150 minutes—and it looks like the regexes for parsing durations only allow up to 2 digits (and no hours). So here's a small change that allows both seconds and minutes to be one or more digits. For this exam, for example, I can now do countdown 150m.

Let me know if there's anything else that would be useful in this PR!

Now it's possible to do `countdown 100m` or `countdown 120s`.
@treyhunner
Copy link
Owner

Nice! My primary use for this is while teaching as well. I'm glad you found it useful @sampsyo.

Thanks for the pull request. The only thing I think it would be nice to have is a test or two for more than 2 digits.

  • Something like this test
  • Something like this test might be nice too, just to confirm that the big numbers display properly

To run the tests you can pip install nox and then run nox. Alternatively you could pip install -e . in a virtual environment and then run pytest directly.

Besides that, this looks great. Thanks!

@sampsyo
Copy link
Author

sampsyo commented May 17, 2024

Good call! I've added a couple of tests along those lines.

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