Docfile commited on
Commit
c3f6f5f
·
verified ·
1 Parent(s): 0f1ab6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -43
app.py CHANGED
@@ -176,9 +176,6 @@ class EvaluationGymnique:
176
  run.font.size = Pt(9)
177
 
178
  def creer_tableau_recapitulatif(self):
179
- # Ajouter un espace avant le tableau récapitulatif
180
- self.document.add_paragraph().space_after = Pt(8)
181
-
182
  note_table = self.document.add_table(rows=3, cols=13)
183
  note_table.style = 'Table Grid'
184
  note_table.alignment = WD_TABLE_ALIGNMENT.CENTER
@@ -259,15 +256,10 @@ class EvaluationGymnique:
259
  run.font.size = Pt(8)
260
 
261
  def ajouter_zone_note(self):
262
- # Créer un paragraphe pour l'espacement
263
- self.document.add_paragraph().space_after = Pt(6)
264
-
265
- # Créer le tableau pour la note finale
266
  zone_note = self.document.add_table(rows=1, cols=2)
267
  zone_note.style = 'Table Grid'
268
  zone_note.alignment = WD_TABLE_ALIGNMENT.RIGHT
269
 
270
- # Configurer la cellule du libellé
271
  cell_libelle = zone_note.cell(0, 0)
272
  cell_libelle.text = "Note finale"
273
  cell_libelle.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.RIGHT
@@ -276,31 +268,28 @@ class EvaluationGymnique:
276
  run.font.size = Pt(12)
277
  run.font.color.rgb = RGBColor(0, 32, 96)
278
 
279
- # Configurer la cellule de saisie (format plus carré)
280
  cell_saisie = zone_note.cell(0, 1)
281
- # Définir une largeur plus petite
282
- cell_saisie.width = Cm(1)
283
- zone_note.rows[0].height = Cm(1)
284
-
285
- # Ajouter le fond gris
286
  shading_elm = parse_xml(f'<w:shd {nsdecls("w")} w:fill="F2F2F2"/>')
287
  cell_saisie._tc.get_or_add_tcPr().append(shading_elm)
288
-
289
- # Ajouter le texte
290
  cell_saisie.text = "/20"
291
  cell_saisie.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
292
  run = cell_saisie.paragraphs[0].runs[0]
293
  run.bold = True
294
  run.font.size = Pt(12)
295
 
296
- # Ajouter un espacement après le tableau
297
  self.document.add_paragraph()
 
298
 
299
  def ajouter_lignes_correcteurs(self):
 
300
  for role in ["Projet", "principal", "ROV"]:
301
  para = self.document.add_paragraph()
302
- para.space_before = Pt(6) # Augmenter l'espace avant
303
- para.space_after = Pt(6) # Augmenter l'espace après
304
  run = para.add_run(f"Correcteur {role} : ")
305
  run.bold = True
306
  para.add_run(".................................................................")
@@ -332,36 +321,13 @@ class EvaluationGymnique:
332
  })
333
 
334
  def generer_document(self, nom_fichier="evaluation_gymnastique.docx"):
335
- # Génération de l'en-tête
336
  self.ajouter_entete_colore()
337
-
338
- # Tableau des éléments techniques
339
  self.creer_tableau_elements()
340
-
341
- # Note pour le jury
342
  self.ajouter_note_jury()
343
-
344
- # Séparation avant les lignes de correcteurs
345
- self.document.add_paragraph().space_after = Pt(6)
346
-
347
- # Lignes des correcteurs
348
- self.ajouter_lignes_correcteurs()
349
-
350
- # Séparation avant le tableau récapitulatif
351
- para_espace = self.document.add_paragraph()
352
- para_espace.space_before = Pt(10)
353
- para_espace.space_after = Pt(10)
354
-
355
- # Tableau récapitulatif
356
  self.creer_tableau_recapitulatif()
357
-
358
- # Zone de note finale
359
  self.ajouter_zone_note()
360
-
361
- # Note pour le candidat
362
  self.ajouter_note_candidat_avec_cadre()
363
-
364
- # Sauvegarde du document
365
  self.document.save(nom_fichier)
366
  return nom_fichier
367
 
 
176
  run.font.size = Pt(9)
177
 
178
  def creer_tableau_recapitulatif(self):
 
 
 
179
  note_table = self.document.add_table(rows=3, cols=13)
180
  note_table.style = 'Table Grid'
181
  note_table.alignment = WD_TABLE_ALIGNMENT.CENTER
 
256
  run.font.size = Pt(8)
257
 
258
  def ajouter_zone_note(self):
 
 
 
 
259
  zone_note = self.document.add_table(rows=1, cols=2)
260
  zone_note.style = 'Table Grid'
261
  zone_note.alignment = WD_TABLE_ALIGNMENT.RIGHT
262
 
 
263
  cell_libelle = zone_note.cell(0, 0)
264
  cell_libelle.text = "Note finale"
265
  cell_libelle.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.RIGHT
 
268
  run.font.size = Pt(12)
269
  run.font.color.rgb = RGBColor(0, 32, 96)
270
 
271
+ # Réduire la largeur pour que la cellule soit plus carrée
272
  cell_saisie = zone_note.cell(0, 1)
273
+ cell_saisie.width = Cm(1.2) # Réduit de 1.5 à 1.2 cm
274
+ zone_note.rows[0].height = Cm(1.2) # Ajusté pour être carré (même valeur que la largeur)
 
 
 
275
  shading_elm = parse_xml(f'<w:shd {nsdecls("w")} w:fill="F2F2F2"/>')
276
  cell_saisie._tc.get_or_add_tcPr().append(shading_elm)
 
 
277
  cell_saisie.text = "/20"
278
  cell_saisie.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
279
  run = cell_saisie.paragraphs[0].runs[0]
280
  run.bold = True
281
  run.font.size = Pt(12)
282
 
283
+ # Ajouter un paragraphe vide pour créer de l'espace
284
  self.document.add_paragraph()
285
+ self.document.add_paragraph() # Un deuxième paragraphe vide pour plus d'espace
286
 
287
  def ajouter_lignes_correcteurs(self):
288
+ # Espace supplémentaire avant les correcteurs ajouté avec le paragraphe ci-dessus
289
  for role in ["Projet", "principal", "ROV"]:
290
  para = self.document.add_paragraph()
291
+ para.space_before = Pt(2)
292
+ para.space_after = Pt(2)
293
  run = para.add_run(f"Correcteur {role} : ")
294
  run.bold = True
295
  para.add_run(".................................................................")
 
321
  })
322
 
323
  def generer_document(self, nom_fichier="evaluation_gymnastique.docx"):
 
324
  self.ajouter_entete_colore()
 
 
325
  self.creer_tableau_elements()
 
 
326
  self.ajouter_note_jury()
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  self.creer_tableau_recapitulatif()
328
+ self.ajouter_lignes_correcteurs()
 
329
  self.ajouter_zone_note()
 
 
330
  self.ajouter_note_candidat_avec_cadre()
 
 
331
  self.document.save(nom_fichier)
332
  return nom_fichier
333