Open Sukarth opened 2 years ago
Hello, I would appreciate your reply since I am still struggling with the problem. @KaappoRaivio
Hello, thanks for your interest! I'll look into your issue within a couple of days.
K
It just seems that you school uses a different naming convention for the classes. Originally this was only for my personal use, so I didn't anticipate usage outside my own school, where all class names are of form <number>: ABC1.23
.
Unfortunately, at this time I have no interest in maintaining this project any further, since it would need a major rewrite. Your issue seems relatively simple to fix.
class Schedule:
...
def __init__(self, courses, dates, details):
self.schedule = [["" for weekday in range(5)] for nth_lesson in range(5)]
self.dates = self.__parse_dates(dates)
self.details = details
for course in courses:
## palkki, title = course.split(": ") # instead of this, do
if ": " in course:
palkki, title = course.split(": ")
else:
# You have to pull the information from elsewhere. I'm not sure what would be the best course of action. Probably depends on the overall structure and conventions your school uses.
#Btw if you are confused, "palkki" is one of the eight slots where lessons are held in Espoo
for timestamp in tuntikiertokaavio[int(palkki)]:
self.schedule[timestamp.nth_lesson][timestamp.day_of_week] = title
And yes, I cringe a little at the fact that half of the variables are in Finnish, and half in English :DD
P.s. you might want to consider redacting identifying information from github issues in the future. At the moment I can see who your teachers are and which school you go to :)
Thanks for responding....
Your reply was really helpful (with the suggestion of redacting identifying information... ), but I am still a bit confused with what that piece of code is supposed to do, since I don't know a lot of python, I tried searching it up, but couldn't find any good answers. Would you mind telling me what is supposed to do what in the code you posted in the above comment?
Hi! Could you please help? @KaappoRaivio @KaappoRaivio
Hello @KaappoRaivio @KaappoRaivio @KaappoRaivio, I made some changes and run the program a couple of times, and I get the name of the subjects as a response, but not the homework of each subject.
These are the last few lines in the terminal window that was running the server:
{'Käsityö.2', 'Kuvataide.2', 'Ruotsin kieli, B1', 'Liikunta', 'Kotitalous.3', 'Biologia', 'UKR.7 OGQ', 'Musiikki.2', 'sHImai.Etäopetus 5-9 ma 16.00', 'Historia', 'Englanti, A1', 'Kemia.3', 'Matematiikka', 'Suomi toisena kielenä ja kirjallisuus.1', 'Espanja, A2.2', 'Terveystieto'}
0
1
2
3
4
127.0.0.1 - - [09/Feb/2022 19:36:59] "GET / HTTP/1.1" 200 -
And as a response from where I sent the request to the server, I get this:
{"courses": {}, "teachers": {}, "upcoming": []}
I think I know the problem, but don't know how to fix it. @KaappoRaivio First answering my above posts would help me understand the code and fix the problem. Thanks @KaappoRaivio in advance. Hope I get a response soon.
Hello @KaappoRaivio , Thanks for making this api, it will help me a lot in my project, if I get past this error. Could you please help me?
I had to make some changes to the code because there were other errors. anyways I sorted them out because I could find info online and could understand them. I unfortunately can't understand this one.
I have added some print commands in the code to get basic logging as you can see below. (I have only pasted part of the logs below)
All the code in file Crawler.py:
Please reply and tell me if you need more information to debug this problem. Could you please tell me what is happening? Looking forward to your response.