Commit 8c886f89 authored by Kiste's avatar Kiste
Browse files

Fix current semester detection

parent 9f680454
......@@ -2,7 +2,6 @@
- Keyring deaktivierbar machen
- Semesterauswahl ohne YAML ermöglichen
- Aktuelles Semester ist nicht immer das letzte JSON-Element!!!
- Keine Doku schreiben
- vll YAML durch JSON ersetzen
File mode changed from 100644 to 100755
......@@ -36,7 +36,14 @@ def logik(path, user, password, blacklist, allsemesters):
for semester in jsemester.json()['semesters']:
holsemester(path + '/' + semester['title'].replace('/', ''), session, blacklist, timestamp, semester)
else:
holsemester(path, session, blacklist, timestamp, jsemester.json()['semesters'][-1])
aktuell = None
for semester in jsemester.json()['semesters']:
if not aktuell:
aktuell = semester
else:
if semester['begin'] > aktuell['begin']:
aktuell = semester
holsemester(path, session, blacklist, timestamp, aktuell)
def holsemester(path, session, blacklist, timestamp, cursemester):
......
......@@ -81,6 +81,3 @@ def main():
exit(1)
logik(path, user, password, blacklist, allsemesters)
if __name__ == '__main__':
main()
Supports Markdown
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