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

Allow stream from sabre/dav (Nextcloud) as URL input #54

Closed
pnposch opened this issue Aug 29, 2019 · 4 comments
Closed

Allow stream from sabre/dav (Nextcloud) as URL input #54

pnposch opened this issue Aug 29, 2019 · 4 comments

Comments

@pnposch
Copy link

pnposch commented Aug 29, 2019

Several implementations use sabre/dav such as Nextcloud. While Nextcloud theoretically should allow to embed public calendars in practice this does not work smoothly when used in iframes. Using the public URI of the calendar in addition with ?export generates ical files which (again theoretically) should work perfectly as input for open-web-calendar. In practice, however, it does not :-(

Example Calendar on Nextcloud:
http://tmp.firrm.de/nextcloud/index.php/apps/calendar/p/tCPCLNkcmw4kp23x/test

Export:
http://tmp.firrm.de/nextcloud/remote.php/dav/public-calendars/tCPCLNkcmw4kp23x?export
(eg. try curl or direct download)

Using OWC:
https://open-web-calendar.herokuapp.com/calendar.html?url=http%3A%2F%2Ftmp.firrm.de%2Fnextcloud%2Fremote.php%2Fdav%2Fpublic-calendars%2FtCPCLNkcmw4kp23x%3Fexport

Maybe the issue is simple, but I couldnt figure it out in sufficient time... Thanks

@niccokunzmann
Copy link
Owner

niccokunzmann commented Aug 29, 2019

Thanks for reporting!
When I open the url in the development version, it works. If I open it on heroku - although running the same code, it fails.
I use it myself to show these calendars, too, so I would like to see it working again.
Also, the examples do not show up #53.

169fedb show the error log in case something breaks. I hope to get more information on why it fails on heroku.

@niccokunzmann
Copy link
Owner

niccokunzmann commented Aug 29, 2019

https://open-web-calendar.herokuapp.com/calendar.events.json?url=http%3A%2F%2Ftmp.firrm.de%2Fnextcloud%2Fremote.php%2Fdav%2Fpublic-calendars%2FtCPCLNkcmw4kp23x%3Fexport
now shows:

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/app/.heroku/python/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/app/.heroku/python/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/app/app.py", line 229, in get_calendar
    entries = get_events(specification)
  File "/app/app.py", line 209, in get_events
    for events in events_list:
  File "/app/.heroku/python/lib/python3.7/concurrent/futures/_base.py", line 586, in result_iterator
    yield fs.pop().result()
  File "/app/.heroku/python/lib/python3.7/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/app/.heroku/python/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/app/.heroku/python/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/app/app.py", line 208, in 
    events_list = e.map(lambda url: retrieve_calendar(url, specification), urls)
  File "/app/app.py", line 191, in retrieve_calendar
    "ical": calendar_event.to_ical().decode("UTF-8"),
  File "/app/.heroku/python/lib/python3.7/site-packages/icalendar/cal.py", line 426, in to_ical
    content_lines = self.content_lines(sorted=sorted)
  File "/app/.heroku/python/lib/python3.7/site-packages/icalendar/cal.py", line 415, in content_lines
    cl = self.content_line(name, value, sorted=sorted)
  File "/app/.heroku/python/lib/python3.7/site-packages/icalendar/cal.py", line 408, in content_line
    return Contentline.from_parts(name, params, value, sorted=sorted)
  File "/app/.heroku/python/lib/python3.7/site-packages/icalendar/parser.py", line 306, in from_parts
    values = values.to_ical()
  File "/app/.heroku/python/lib/python3.7/site-packages/icalendar/prop.py", line 395, in to_ical
    tzid = tzid_from_dt(dt)
  File "/app/.heroku/python/lib/python3.7/site-packages/icalendar/parser.py", line 54, in tzid_from_dt
    if hasattr(dt.tzinfo, 'zone'):
AttributeError: 'datetime.date' object has no attribute 'tzinfo'

Which seems to be solved in 0.1.8b of
niccokunzmann/python-recurring-ical-events#7
I updated it in 3d0bbb8.
Let's see.

@niccokunzmann
Copy link
Owner

niccokunzmann commented Aug 29, 2019

Please have a look. Now, the events are shown again.
If you like, you can close it, if you see it working.

@pnposch
Copy link
Author

pnposch commented Aug 29, 2019

Yes perfect! Thanks a lot.

@pnposch pnposch closed this as completed Aug 29, 2019
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

No branches or pull requests

2 participants