Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
fix absences in case of afternoon hours
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Oct 3, 2023
1 parent 3a300f7 commit 60b726d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions gimsisapi/formtagparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,16 @@ def get_absences(text, type: int):
current_day = f[0].text.strip()
days[current_day] = []
f = f[1:]


u = f[0].text.strip()
if "P" in u:
ura = 7 + int(u.replace("P", ""))
else:
ura = int(u)

days[current_day].append(
SubjectAbsenceStatus(
int(f[0].text.strip()),
ura,
f[1].text.strip(),
f[2].text.strip(),
f[3].find("div").text.strip(),
Expand Down
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ async def main():
# classes, days = await gimsis.fetch_timetable()
# print(classes, days)
# await gimsis.fetch_timetable("12 09 2022")
# absences = await gimsis.fetch_absences("01.09.2022", type=AbsenceType.by_days)
# print(absences)
absences = await gimsis.fetch_absences("01.09.2022", type=AbsenceType.by_days)
print(absences)
# gradings = await gimsis.fetch_gradings()
# print(gradings)
grades = await gimsis.fetch_grades()
print(grades)
#grades = await gimsis.fetch_grades(year=2022)
#print(grades)
#profile = await gimsis.my_profile()
#print(profile)
#teachers = await gimsis.fetch_teachers()
Expand Down

0 comments on commit 60b726d

Please sign in to comment.