Skip to content

Commit c2d3de0

Browse files
committed
fix: parsing errors and docker-compose add
1 parent ef0bf64 commit c2d3de0

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
notifynotes:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
container_name: notifynotes
7+
env_file: .env
8+
volumes:
9+
- ./:/config
10+
restart: unless-stopped
11+
networks:
12+
- notifynotes_net
13+
14+
networks:
15+
notifynotes_net:
16+
driver: bridge

src/parse.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def convert_notes_to_json(url_response, json_file):
8282
section_map = {
8383
"Projet": "Projet",
8484
"Contrôle Continu": "Contrôle Continu",
85+
"Contrôle continu": "Contrôle Continu",
8586
"Contrôle Continu": "Contrôle Continu",
87+
"Contrôle continu": "Contrôle Continu",
8688
"Examen": "Examen"
8789
}
8890

@@ -108,11 +110,19 @@ def convert_notes_to_json(url_response, json_file):
108110
for key in ["Pondération Weight", "Pond�ration Weight", "PondÁration Weight"]:
109111
if key in sous_ligne:
110112
sous_ligne["pondération - section"] = sous_ligne.pop(key)
111-
if "Notes Grades" in sous_ligne:
112-
sous_ligne["note"] = sous_ligne.pop("Notes Grades")
113-
# Séparation des notes et pondérations multiples
114-
note_val = sous_ligne.pop("note", "")
115-
pond_val = sous_ligne.pop("pondération", "")
113+
# Extraction robuste de la note et de la pondération
114+
note_val = ""
115+
pond_val = ""
116+
# Cherche la note dans toutes les colonnes possibles
117+
for key in ["Notes Grades", "note", "note item-ev1"]:
118+
if key in sous_ligne and sous_ligne[key]:
119+
note_val = sous_ligne.pop(key)
120+
break
121+
# Cherche la pondération dans toutes les colonnes possibles
122+
for key in ["Pondération Weight", "Pond�ration Weight", "PondÁration Weight", "coefficient item-ev1", "pondération"]:
123+
if key in sous_ligne and sous_ligne[key]:
124+
pond_val = sous_ligne.pop(key)
125+
break
116126
notes = []
117127
if note_val and ("(" in note_val and ")" in note_val):
118128
notes = split_notes(note_val)

0 commit comments

Comments
 (0)