def FindLecturersAndTimes(self, year, semester, id, groups): result = self.POST(ActualCourse, json={ "selectedAcademicYear": year, "selectedSemester": semester, "selectedExtension": 1, "selectedCategory": None, "freeSearch": None }) for page in range(toJson(result)["totalPages"]): result = self.POST(ActualCourse, json={ "current": page + 1, "selectedAcademicYear": year, "selectedSemester": semester, "selectedExtension": 1, "selectedCategory": None, "freeSearch": None }) for item in toJson(result)["items"]: if item["courseFullNumber"].split(".")[0] == str(id): result2 = self.POST(LoadCourseDetails + str(item["id"]), None) result2 = toJson(result2) groups2 = list( filter( lambda i: str( int(i["groupFullNumber"].split(".")[3])) in list(map(str, groups)), result2["groups"])) if (len(groups2) == len(groups)): return list( map( lambda j: j["courseGroupLecturers"] + ". " + j[ "courseGroupMeetings"], groups2)) return None
def LoadScheduleTracks(self): r = self.POST(LoadScheduleData, json={ 'username': self.username, 'password': self.password }) return toJson(r)["tracks"]
def Login(self): r = self.POST(loginUrl, json={ 'username': self.username, 'password': self.password }) return toJson(r)['success']
def FindCourseName(self, year, semester, id): result = self.POST(ActualCourse, json={ "selectedAcademicYear": year, "selectedSemester": semester, "selectedExtension": None, "selectedCategory": None, "freeSearch": None }) for page in range(toJson(result)["totalPages"]): result = self.POST(ActualCourse, json={ "current": page + 1, "selectedAcademicYear": year, "selectedSemester": semester, "selectedExtension": None, "selectedCategory": None, "freeSearch": None }) for item in toJson(result)["items"]: if item["courseFullNumber"].split(".")[0] == str(id): return item["courseName"]
def OpenSchedule(self): self.GET(ScheduleStart) r = self.POST(BuildScheduleStart, json={ 'username': self.username, 'password': self.password }) whatOpen = toJson(r)["semestersScheduleCreation"] if whatOpen == []: return False year = whatOpen[0]["academicYearId"] semester = whatOpen[0]["semesterId"] return {"academicYear": year, "semester": semester}
def ScheduleWarnings(self): r = self.POST(LoadRegWarnings, json='') return toJson(r)["regWarnings"]