Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] list index problem in get_my_timetable() #81

Open
rine77 opened this issue Nov 6, 2024 · 1 comment
Open

[Bug] list index problem in get_my_timetable() #81

rine77 opened this issue Nov 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rine77
Copy link

rine77 commented Nov 6, 2024

Describe the bug
I cant use get_my_timetable() from your example.
In my case I think there comes only one element but in your code you use [1]...

Your code

import datetime

from edupage_api import Edupage

edupage = Edupage()
edupage.login_auto("bla@blubb", "pass")

# My timetable
date = datetime.date(2024, 11, 1)
timetable = edupage.get_my_timetable(date)

Error message

Traceback (most recent call last):
  File "/home/rine/Projekte/homeassistantedupage/custom_components/homeassistantedupage/test/test.py", line 10, in <module>
    timetable = edupage.get_my_timetable(date)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rine/Projekte/homeassistantedupage/.venv/lib/python3.12/site-packages/edupage_api/__init__.py", line 164, in get_my_timetable
    return Timetables(self).get_my_timetable(date)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rine/Projekte/homeassistantedupage/.venv/lib/python3.12/site-packages/edupage_api/module.py", line 100, in __impl
    return method(self, *method_args, **method_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rine/Projekte/homeassistantedupage/.venv/lib/python3.12/site-packages/edupage_api/timetables.py", line 282, in get_my_timetable
    plan = self.__get_date_plan(date)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rine/Projekte/homeassistantedupage/.venv/lib/python3.12/site-packages/edupage_api/timetables.py", line 180, in __get_date_plan
    curriculum_json = curriculum_response.text.split(response_start)[1].rsplit(
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Expected behavior
It should deliver the timetable for the selected date (2024/11/10)

Version

  • Edupage API version: 0.11.0
  • Python version: 3.12
@ivanhrabcak
Copy link
Collaborator

Can you send me a message on discord (ivicek)? It would be best if we could debug this issue together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants