simple usecase for icalevents: Print events occurring in the next 7 days.

pull/1/head
Thomas Irgang 2017-07-19 10:06:18 +02:00
rodzic 556b9a600d
commit 09350570e6
1 zmienionych plików z 24 dodań i 0 usunięć

24
main.py 100644
Wyświetl plik

@ -0,0 +1,24 @@
from icalevents.icalevents import events
if __name__ == '__main__':
with open('calendars.txt', mode='r', encoding='utf-8') as f:
while True:
line = f.readline()
if not line:
break
name, url = line.split(maxsplit=1)
name = name.strip()
url = url.strip()
fix_apple = False
if name == 'icloud':
fix_apple = True
es = events(url, fix_apple=fix_apple)
print("%d event found for URL %s" % (len(es), url))
for e in es:
print(e)