EdupageAPI / edupage-api

A python library for accessing your Edupage account
https://edupageapi.github.io/edupage-api/
GNU General Public License v3.0
67 stars 13 forks source link

Getting timetable not working #4

Closed cfpwastaken closed 3 years ago

cfpwastaken commented 3 years ago

It's just throwing this exception: Traceback (most recent call last): File "adw.py", line 9, in <module> timetable = edupage.get_timetable(today) # returns a list of EduLesson File "C:\Users\chaos\AppData\Local\Programs\Python\Python37-32\lib\site-packages\edupage_api\__init__.py", line 76, in get_timetable subject_name = self.ids.id_to_subject(subject_id) File "C:\Users\chaos\AppData\Local\Programs\Python\Python37-32\lib\site-packages\edupage_api\utils.py", line 35, in id_to_subject return self.dbi.get("subjects").get(s_id).get("short") AttributeError: 'NoneType' object has no attribute 'get'

ivanhrabcak commented 3 years ago

Does this happen every time you start the example? Do you have a 'dbi' key in the dictionary when you print edupage.data?

Does the initial edupage.login() return true?

Thank you for reporting this issue.

cfpwastaken commented 3 years ago

Hello, Yes edupage.login() returns true. I don't know currently what you mean with dbi in edupage.data, i just copy-pasted the code (and changed my username/password), and that's it.

ivanhrabcak commented 3 years ago

dbi is a attribute where edupage stores some data useful for converting teacher/student/classrom/subject... ids to names. If this key is missing, You get that error. I'm trying to figure out if something is wrong with my code, or your school doesn't have the data for all teachers.

Did you try the other examples? if you do

print(edupage.data.get("dbi") == None)

Do you see True or False?

ivanhrabcak commented 3 years ago

Hello, this problem was in my code. Is it fixed now?