Skip to content

http ical links trigger errors #7

@errrrata

Description

@errrrata

When adding an https ical link in configuration file (using a google calendar ical link), there are a number of errors:

Traceback (most recent call last):
  File "main.py", line 2, in <module>
    import shpi.main
  File "/home/pi/zero_main_application/shpi/main.py", line 360, in <module>
    textchange, activity, slide_offset)
  File "/home/pi/zero_main_application/shpi/slides/ical2.py", line 108, in inloop
    init()
  File "/home/pi/zero_main_application/shpi/slides/ical2.py", line 28, in init
    icalfile = requests.get(config.ICALLINK).text #TODO httprequest stuff needed here?
NameError: name 'requests' is not defined

since 'requests' is not imported.
If importing 'requests' in ical2.py this error appears:

Traceback (most recent call last):
  File "main.py", line 2, in <module>
    import shpi.main
  File "/home/pi/zero_main_application/shpi/main.py", line 360, in <module>
    textchange, activity, slide_offset)
  File "/home/pi/zero_main_application/shpi/slides/ical2.py", line 109, in inloop
    init()
  File "/home/pi/zero_main_application/shpi/slides/ical2.py", line 32, in init
    gcal = Calendar.from_ical(icalfile.read())
AttributeError: 'str' object has no attribute 'read'

After working around this issue, a new error appears:

Traceback (most recent call last):
  File "main.py", line 2, in <module>
    import shpi.main
  File "/home/pi/zero_main_application/shpi/main.py", line 360, in <module>
    textchange, activity, slide_offset)
  File "/home/pi/zero_main_application/shpi/slides/ical2.py", line 110, in inloop
    init()
  File "/home/pi/zero_main_application/shpi/slides/ical2.py", line 40, in init
    tzinfo=None) - now2, reverse=False)  # order dates soonist to now to farthest
  File "/home/pi/zero_main_application/shpi/slides/ical2.py", line 38, in <lambda>
    tzinfo=None) - now2 > timedelta(0), components)  # filter out past events
TypeError: 'tzinfo' is an invalid keyword argument for replace()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions