python3.5 compatibility

This commit is contained in:
boyska 2021-08-17 23:34:05 +02:00
parent 47a2307e87
commit 2fe5dcfb65

View file

@ -72,7 +72,7 @@ class Converter:
cal = Calendar.from_ical(file_content, multiple=True)
for subcal in cal:
for ev in self.get_vevents_from_calendar(subcal):
uid: str = ev.decoded("uid").decode("ascii")
uid = ev.decoded("uid").decode("ascii")
self.talks[uid] = ev
self.talk_room[uid] = room
@ -94,7 +94,7 @@ class HugoConverter(Converter):
fname = "%s.md" % uid
fpath = self.args.out_md_dir / fname
self.changed_files.append(fpath)
with open(fpath, "w") as buf:
with open(str(fpath), "w") as buf:
# preamble
buf.write("---\n")
yaml.safe_dump(
@ -151,7 +151,7 @@ class HugoConverter(Converter):
out = {"schedule": list(days.values())}
# dump, finally
with open(self.args.out_schedule, "w") as buf:
with open(str(self.args.out_schedule), "w") as buf:
yaml.safe_dump(out, buf)
self.changed_files.append(self.args.out_schedule)