44import requests
55from bs4 import BeautifulSoup
66
7- __version__ = ( 0 , 0 , 1 )
7+ VERSION = "0.3"
88
99
1010class LoginError (ValueError ):
@@ -170,7 +170,8 @@ def _get_modules(self):
170170 modules .append (Module (
171171 num = num ,
172172 name = cells [1 ].text .strip (),
173- credits = float (cells [3 ].text .strip ().replace (',' , '.' )),
173+ credits = float (
174+ cells [3 ].text .strip ().replace (',' , '.' )),
174175 status = cells [4 ].text .strip (),
175176 semesters = [semester ],
176177 id = exams_id ,
@@ -203,7 +204,8 @@ def get_exams_for_module(self, module: Module):
203204 :param module: The module.
204205 :return: A list of exams.
205206 """
206- response = self .session .get (self .create_url ('RESULTDETAILS' , f",-N{ module .id } " ))
207+ response = self .session .get (self .create_url (
208+ 'RESULTDETAILS' , f",-N{ module .id } " ))
207209 # The webservice doesn't correctly set Content-Type: text/html; charset=utf-8
208210 # so requests uses ISO-8859-1 which is not correct. Requests is smart enough to
209211 # convert the response to UTF-8 if we tell it to take a guess at the real encoding.
@@ -216,7 +218,8 @@ def get_exams_for_module(self, module: Module):
216218 for row in exam_table .find_all ("tr" ):
217219 cells = row .find_all ('td' )
218220 if len (cells ) == 1 and 'level02' in cells [0 ]["class" ]:
219- current_heading = cells [0 ].text .strip () # variable to persist header into the next iteration
221+ # variable to persist header into the next iteration
222+ current_heading = cells [0 ].text .strip ()
220223 if len (cells ) == 6 and all ("tbdata" in cell ["class" ] for cell in cells ):
221224 try :
222225 grade = float (cells [3 ].text .strip ().replace ("," , "." ))
0 commit comments