Extract courses to environment variable

This commit is contained in:
Gabriel Augendre 2016-09-17 00:23:31 +02:00
parent 60f6e6b339
commit 0ff469a195
No known key found for this signature in database
GPG key ID: D2B6A5B41FC438B1

18
app.py
View file

@ -11,24 +11,10 @@ def hello():
url = os.environ.get('URL', None) url = os.environ.get('URL', None)
if url is None: if url is None:
return "" return ""
cal_str = urllib.request.urlopen(url).read() cal_str = urllib.request.urlopen(url).read()
FILTERED_EVENTS = [ FILTERED_EVENTS = os.environ.get('COURSES', '').split(',')
'MGL',
'SYD',
'SQE',
'COM',
'RSM',
'ANG1',
'DLG1',
'SPO1',
'SPO2',
'STA1',
'PST',
'SEC',
'DIA'
]
cal = Component.from_ical(cal_str) cal = Component.from_ical(cal_str)
other = Calendar() other = Calendar()