[BUG] - error when event title is empty
zl4sha opened this issue · comments
Describe the bug
Preparing an ical file with an event that has no string given for the summary results in an error message that halts the program and prevents inkycal from updating the eink display
To Reproduce
Steps to reproduce the behavior:
- Configure inkycal to render a an iCal calendar with the calendar module
- create a new event without a title/summary
- let inkycal render the event
- see the error message - lstrip throws an error message for an empty string.
22-01-2024 09:02:40 | inkycal.main | ERROR: Exception in module 1
Traceback (most recent call last):
File "/home/<user>/Inkycal/inkycal/main.py", line 302, in run
black, colour = module.generate_image()
File "/home/<user>/Inkycal/inkycal/modules/inkycal_calendar.py", line 293, in>
month_events = parser.get_events(month_start, month_end, self.timezone)
File "/home/<user>/Inkycal/inkycal/modules/ical_parser.py", line 135, in get_>
if events: self.parsed_events += list(events)
File "/home/<user>/Inkycal/inkycal/modules/ical_parser.py", line 122, in <gen>
'title': events.get('SUMMARY').lstrip(),
Expected behavior
The event is processed by rendering a default placeholder or empty string, e.g. "" or "".
Hi there and welcome to Inkycal. Thanks for opening this issue. As this is your first issue in this repository, please read through the contributing guidelines
@zl4sher I had a look at this and it seems you are using a little outdated version of Inkycal. This is evident from the provided traceback as line 122
in ical_parser.py
does no longer contain the same code as it shows in your version.
For reference, this is how the current version looks like:
'title': events.get('SUMMARY').lstrip() if events.get('SUMMARY') else "",
In short, it is checking if the title exists and then removing any whitespace from the ends. Therefore, it should not be a bug.
Before I look into this further, please update to the latest version of Inkycal via:
cd ~/Inkycal
source venv/bin/activate
git pull
pip install gpiozero
# optional: testing
# python inky_run.py
Please let me know if this fixes the issue you are facing 👍
Marking this issue as stale due to inactivity