Commit f1535a1a authored by mit's avatar mit

bugfix when refreshing webcal

parent ab395dac
......@@ -12,6 +12,7 @@ class Cdav:
self._list = caldav_dict
self._conf = conf
self._icals = [] # list of Icalendar, for each caldav
# proper url if webcal; None if offline
self._iscaldav = [] # list of True/False
self._tags = [] # associated tags
self._cal = [] # single list of all events in Agenda class
......@@ -47,11 +48,11 @@ class Cdav:
flag = False # it's a webcal
if cdav["url"][:7] == "webcals": # webcal
urlh = "https" + cdav["url"][7:]
cal = urlopen(urlh).read()
cal = urlopen(urlh).read().decode()
else:
urlh = "http" + cdav["url"][6:]
cal = urlopen(urlh).read().decode()
self._icals.append(cal)
self._icals.append(urlh)
self._iscaldav.append(flag)
except:
err = _("Error: can't contact caldav ")+cdav["url"]
......@@ -115,7 +116,9 @@ class Cdav:
tmpcal.add_event(ecul)
else:
if cal: # None if unreachable, else a webcal
# in a webcal, _icals is url
# in a webcal, we get everything.
cal = urlopen(cal).read().decode()
ical = icalendar.Calendar.from_ical(cal)
agendacul = calendar.Agenda2Cul(ical, [],
self._tags[ind],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment