3
3
"""
4
4
5
5
import asyncio
6
+ import logging
6
7
import re
7
8
import unicodedata
8
9
22
23
class Absolvent (Base , commands .Cog ):
23
24
def __init__ (self , bot : Rubbergod ):
24
25
super ().__init__ ()
26
+ self .logger = logging .getLogger ("rubbergod" )
25
27
self .bot = bot
26
28
27
29
@commands .slash_command (name = "diplom_help" , description = MessagesCZ .diplom_help_brief )
@@ -119,7 +121,7 @@ def remove_accents(input_str):
119
121
master_thesis = "" .join (xDoc_thesis .xpath (breadcrumb_xpath .format (3 , "diplomové práce" )))
120
122
bachelor_thesis = "" .join (xDoc_thesis .xpath (breadcrumb_xpath .format (3 , "bakalářské práce" )))
121
123
thesis_author_without_degree_surname_first = "" .join (
122
- xDoc_thesis .xpath ('//div[./h5/.="Authors"]//div/a /text()' )
124
+ xDoc_thesis .xpath ('//div[./h5/.="Authors"]//div//text()' )
123
125
).strip ()
124
126
habilitation_date = "" .join (xDoc_thesis .xpath ('//div[./h5/.="Date of acceptance"]//div/span/text()' ))
125
127
result = "" .join (xDoc_thesis .xpath ('//div[./h5/.="Result of defence"]//div/span/text()' ))
@@ -143,6 +145,14 @@ def remove_accents(input_str):
143
145
and thesis_author_without_degree_surname_first == full_name_without_degree_surname_first
144
146
):
145
147
await inter .edit_original_response (MessagesCZ .web_error )
148
+ self .logger .info (f"[Absolvent] Thesis verification failed for thesis: { thesis_url } " )
149
+ self .logger .info ("[Absolvent] Data parsed from the website:" )
150
+ self .logger .info (f"Degree: { degree } " )
151
+ self .logger .info (f"Thesis: { master_thesis } { bachelor_thesis } " )
152
+ self .logger .info (f"diploma_year: { diploma_year } " )
153
+ self .logger .info (f"habilitation_year: { habilitation_year } " )
154
+ self .logger .info (f"faculty: { faculty } " )
155
+ self .logger .info (f"result: { result } " )
146
156
return
147
157
148
158
# DIPLOMA VALIDITY CHECK
0 commit comments