Aller au contenu
login
arrow_backRetour aux issues
collective/icalendar #1421

Make all properties available to avoid additional loop

ecoDébutant good first issue

descriptionDescription

## Describe the bug On the example https://icalendar.readthedocs.io/en/latest/how-to/usage.html#read-calendar-from-file, we can see see some properties are available, for example the summary that can be accessed like that: `event.get("SUMMARY")` And the trigger property that can be accessed like that (https://icalendar.readthedocs.io/en/latest/reference/api/icalendar.cal.event.html#icalendar.cal.event.Event.alarms): `event.alarms.times[0].trigger` However it looks like we cannot access the ACTION property to check for example if the value is DISPLAY or AUDIO. If I understand correctly, this would require an additional loop using the function property_items. ## Expected behavior To avoid unnecessary processing and battery usage, especially on Linux smartphones that don't have a long autonomy like the PinePhone, it should be possible to make all properties available or at least additional properties available on demand the first time the ICS file is parsed in the function from_ical so we don't have to create an additional loop. This could also improve performance by avoiding duplicate work. ## Environment - Operating system: Mobian (Debian 13) with Phosh on the PinePhone - Python version: Python 3.13.5 - `icalendar` version: 7.1.2 ## Additional context I tested with the ICS file generated by Gnome Calendar.
codeOuvre sur GitHub