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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
312b05a
add example calendars
niccokunzmann Oct 6, 2024
43e07fc
Create interface that I would like to use.
niccokunzmann Oct 22, 2024
d4d1074
Add test for absolute alarm
niccokunzmann Oct 22, 2024
dee670d
fix syntax errors for alarms test
niccokunzmann Oct 22, 2024
4c2ac64
Calculate absolute alarm times
niccokunzmann Oct 22, 2024
b5d9b75
TODO test for edge case
niccokunzmann Oct 22, 2024
f993bd9
Raise exception on missing information
niccokunzmann Oct 23, 2024
e358101
Calculate alarms relative to the start
niccokunzmann Oct 23, 2024
e29c545
Compute alarms relative to their end
niccokunzmann Oct 23, 2024
560acb9
Collect alarms from event
niccokunzmann Oct 23, 2024
3047209
Add DTSTAMP property
niccokunzmann Oct 23, 2024
914b204
Improve error message if wrong provider is used
niccokunzmann Oct 23, 2024
51099d4
Make sure the UTC datetime is returned by DTSTAMP
niccokunzmann Oct 23, 2024
61dc8c6
Improve docs and add LAST_MODIFIED
niccokunzmann Oct 23, 2024
09cf9b1
Allow acknowledgement of alarms
niccokunzmann Oct 23, 2024
681c064
replace Thunderbird example
niccokunzmann Oct 23, 2024
610a96f
Check optional timezone argument error
niccokunzmann Oct 23, 2024
463a5f0
Implement alarm algorithm of Thunderbird
niccokunzmann Oct 23, 2024
ebbf54b
Improve docs and remove print
niccokunzmann Oct 23, 2024
41244ba
Document vDatetime.from_ical
niccokunzmann Oct 25, 2024
c3bd555
Test the snoozing of alarms
niccokunzmann Oct 25, 2024
92dae9c
Test RFC 9074 alarms
niccokunzmann Oct 25, 2024
d8292ce
Document alarms module
niccokunzmann Oct 26, 2024
20eb10b
Create usage example documentation
niccokunzmann Oct 26, 2024
3b12b90
Create alarms attribute
niccokunzmann Oct 26, 2024
da5e4fa
Merge branch 'main' into issue-716-alarms
niccokunzmann Oct 26, 2024
b1d18ec
Make doctests run
niccokunzmann Oct 26, 2024
a5170e4
Documents Alarm.DURATION
niccokunzmann Oct 26, 2024
ff8552b
log changes
niccokunzmann Oct 26, 2024
42d330f
log changes
niccokunzmann Oct 26, 2024
0a23c55
Merge branch 'main' into issue-716-alarms
niccokunzmann Oct 26, 2024
b3fa5b6
remove old file
niccokunzmann Oct 30, 2024
07d8d92
Compute relative and absolute alarm triggers in the Alarm component
niccokunzmann Oct 30, 2024
78b9e5b
log changes
niccokunzmann Oct 30, 2024
5ea719c
Improve documentation and fix edge cases
niccokunzmann Oct 30, 2024
fab00aa
use new alarm attributes
niccokunzmann Oct 30, 2024
72b2489
Test incomplete alarms
niccokunzmann Nov 2, 2024
3a61ba0
remove todo
niccokunzmann Nov 2, 2024
761a166
Test deleting values
niccokunzmann Nov 2, 2024
e74bebb
Update CHANGES.rst
niccokunzmann Nov 14, 2024
a3598d7
Update src/icalendar/alarms.py
niccokunzmann Nov 14, 2024
4e7b0fa
Update src/icalendar/alarms.py
niccokunzmann Nov 14, 2024
df9c811
Update src/icalendar/alarms.py
niccokunzmann Nov 14, 2024
bff2428
Update src/icalendar/tools.py
niccokunzmann Nov 14, 2024
ca2995b
Update src/icalendar/tests/test_pytz_zoneinfo_integration.py
niccokunzmann Nov 14, 2024
286d0cc
Update src/icalendar/cal.py
niccokunzmann Nov 14, 2024
a8b1ed8
Update src/icalendar/cal.py
niccokunzmann Nov 14, 2024
b9228e9
Update src/icalendar/cal.py
niccokunzmann Nov 14, 2024
c92b272
Update src/icalendar/cal.py
niccokunzmann Nov 14, 2024
b63e9f1
Update src/icalendar/cal.py
niccokunzmann Nov 14, 2024
a44d151
Update src/icalendar/tests/test_issue_716_alarm_time_computation.py
niccokunzmann Nov 14, 2024
bdfd9d2
Update src/icalendar/cal.py
niccokunzmann Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Minor changes:
- Added ``end``, ``start``, ``duration``, ``DTSTART``, ``DUE``, and ``DURATION`` attributes to ``Todo`` components. See `Issue 662`_.
- Format test code with Ruff. See `Issue 672 <https://github.com/collective/icalendar/issues/672>`_.
- Document the Debian package. See `Issue 701 <https://github.com/collective/icalendar/issues/701>`_.
- Document ``vDatetime.from_ical``
- Allow passing a ``datetime.date`` to ``TZP.localize_utc`` and ``TZP.localize`` methods.
- Document component classes with description from :rfc:`5545`.

Breaking changes:
Expand All @@ -19,6 +21,13 @@ New features:

- Add ``VALARM`` properties for :rfc:`9074`. See `Issue 657 <https://github.com/collective/icalendar/issues/657>`_
- Test compatibility with Python 3.13
- Add ``icalendar.alarms`` module to calculate alarm times. See `Issue 716 <https://github.com/collective/icalendar/issues/716>`_.
- Add ``Event.alarms`` and ``Todo.alarms`` to access alarm calculation.
- Add ``Component.DTSTAMP`` and ``Component.LAST_MODIFIED`` properties for datetime in UTC.
- Add ``Component.is_thunderbird()`` to check if the component uses custom properties by Thunderbird.
- Add ``X_MOZ_SNOOZE_TIME`` and ``X_MOZ_LASTACK`` properties to ``Event`` and ``Todo``.
- Add ``Alarm.ACKNOWLEDGED``, ``Alarm.TRIGGER``, ``Alarm.REPEAT``, and ``Alarm.DURATION`` properties
as well as ``Alarm.triggers`` to calculate alarm triggers.

Bug fixes:

Expand Down
7 changes: 7 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
API Reference
-------------

icalendar.alarms
++++++++++++++++

.. automodule:: icalendar.alarms
:members:


icalendar.cal
+++++++++++++

Expand Down
14 changes: 14 additions & 0 deletions src/icalendar/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from icalendar.alarms import (
Alarms,
AlarmTime,
ComponentEndMissing,
ComponentStartMissing,
IncompleteAlarmInformation,
LocalTimezoneMissing,
)
from icalendar.cal import (
Alarm,
Calendar,
Expand Down Expand Up @@ -94,4 +102,10 @@
"vMonth",
"IncompleteComponent",
"InvalidCalendar",
"Alarms",
"AlarmTime",
"ComponentEndMissing",
"ComponentStartMissing",
"IncompleteAlarmInformation",
"LocalTimezoneMissing",
]
Loading
Loading