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

Add calculation of alarm times #737

Merged
merged 52 commits into from
Nov 14, 2024

Conversation

niccokunzmann
Copy link
Member

@niccokunzmann niccokunzmann commented Oct 25, 2024

This contributes to #716 by adding an icalendar.Alarms module.
This module allows calculating the alarm times.
It has been tested with

  • RFC 9074
  • Google
  • Outlook
  • Nextcloud
  • Thunderbird
  • Etar

TODO:

  • simple interface in Todo and Event
  • fix # TODO: comments
  • add changelog entry
  • implement tests that are todo
  • access relative alarm times from start and end as property of Alarms

📚 Documentation preview 📚: https://icalendar--737.org.readthedocs.build/

@coveralls
Copy link

coveralls commented Oct 25, 2024

Pull Request Test Coverage Report for Build 11836256339

Details

  • 575 of 583 (98.63%) changed or added relevant lines in 12 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 97.708%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/icalendar/cal.py 88 89 98.88%
src/icalendar/alarms.py 127 130 97.69%
src/icalendar/timezone/tzp.py 12 16 75.0%
Totals Coverage Status
Change from base Build 11763222108: 0.2%
Covered Lines: 4130
Relevant Lines: 4224

💛 - Coveralls

@niccokunzmann niccokunzmann mentioned this pull request Oct 26, 2024
7 tasks
@niccokunzmann niccokunzmann marked this pull request as ready for review November 2, 2024 13:21
@niccokunzmann
Copy link
Member Author

@stevepiercy, could you review the docs?
@jacadzaca, do you have time to have a look at this?

@stevepiercy
Copy link
Member

@niccokunzmann FYI, I'm backlogged and slammed with preparation for PloneConf 2024. I estimate it will be at least a week until I can review icalendar PRs.

Copy link
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

I caught only a few typos and Oxford comma issues. This is an excellent feature.

I approve once you review and make the changes.

CHANGES.rst Outdated Show resolved Hide resolved
src/icalendar/alarms.py Outdated Show resolved Hide resolved
src/icalendar/alarms.py Outdated Show resolved Hide resolved
src/icalendar/alarms.py Outdated Show resolved Hide resolved
src/icalendar/tools.py Outdated Show resolved Hide resolved
src/icalendar/cal.py Outdated Show resolved Hide resolved
src/icalendar/cal.py Outdated Show resolved Hide resolved
src/icalendar/cal.py Outdated Show resolved Hide resolved
src/icalendar/cal.py Outdated Show resolved Hide resolved
src/icalendar/cal.py Outdated Show resolved Hide resolved
@niccokunzmann
Copy link
Member Author

@stevepiercy Thanks for reviewing the docs!

After I merging this, I will use the functionality for recurring-ical-events to calculate if an alarm happens within a time span.
I might come back with improvements in follow-up PRs.

@niccokunzmann
Copy link
Member Author

Thanks for the review again! The tests pass and I added all your suggestions. Merging ...

@niccokunzmann niccokunzmann merged commit 6bc1d44 into collective:main Nov 14, 2024
18 checks passed
@niccokunzmann niccokunzmann deleted the issue-716-alarms branch November 14, 2024 11:46
@niccokunzmann niccokunzmann mentioned this pull request Nov 14, 2024
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.

3 participants