Docfile commited on
Commit
076ee62
·
verified ·
1 Parent(s): 5af1d11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -21
app.py CHANGED
@@ -256,12 +256,10 @@ class EvaluationGymnique:
256
  run.font.size = Pt(8)
257
 
258
  def ajouter_zone_note(self):
259
- # Créer une table avec une seule ligne et deux colonnes
260
  zone_note = self.document.add_table(rows=1, cols=2)
261
  zone_note.style = 'Table Grid'
262
  zone_note.alignment = WD_TABLE_ALIGNMENT.RIGHT
263
 
264
- # Configurer la cellule pour le libellé "Note finale"
265
  cell_libelle = zone_note.cell(0, 0)
266
  cell_libelle.text = "Note finale"
267
  cell_libelle.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.RIGHT
@@ -270,37 +268,28 @@ class EvaluationGymnique:
270
  run.font.size = Pt(12)
271
  run.font.color.rgb = RGBColor(0, 32, 96)
272
 
273
- # Configurer la cellule pour la zone de saisie de note (en forme de carré)
274
  cell_saisie = zone_note.cell(0, 1)
275
- # Définir une largeur très réduite pour la cellule de saisie
276
- cell_saisie.width = Cm(1.0)
277
- # Définir la même hauteur que la largeur pour avoir un carré
278
- zone_note.rows[0].height = Cm(1.0)
279
- # Appliquer un fond gris clair
280
  shading_elm = parse_xml(f'<w:shd {nsdecls("w")} w:fill="F2F2F2"/>')
281
  cell_saisie._tc.get_or_add_tcPr().append(shading_elm)
282
- # Ajouter le contenu "/20"
283
  cell_saisie.text = "/20"
284
  cell_saisie.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
285
  run = cell_saisie.paragraphs[0].runs[0]
286
  run.bold = True
287
- run.font.size = Pt(10)
288
 
289
- # Ajouter des paragraphes vides pour l'espacement
290
  self.document.add_paragraph()
291
- self.document.add_paragraph()
292
- self.document.add_paragraph() # Troisième paragraphe vide pour encore plus d'espace
293
 
294
  def ajouter_lignes_correcteurs(self):
295
- # Ajouter des paragraphes vides supplémentaires pour plus d'espace
296
- self.document.add_paragraph()
297
- self.document.add_paragraph()
298
-
299
- # Ajouter les lignes pour les correcteurs
300
  for role in ["Projet", "principal", "ROV"]:
301
  para = self.document.add_paragraph()
302
- para.space_before = Pt(6) # Augmenté de 2 à 6 points
303
- para.space_after = Pt(6) # Augmenté de 2 à 6 points
304
  run = para.add_run(f"Correcteur {role} : ")
305
  run.bold = True
306
  para.add_run(".................................................................")
@@ -336,8 +325,8 @@ class EvaluationGymnique:
336
  self.creer_tableau_elements()
337
  self.ajouter_note_jury()
338
  self.creer_tableau_recapitulatif()
339
- self.ajouter_zone_note()
340
  self.ajouter_lignes_correcteurs()
 
341
  self.ajouter_note_candidat_avec_cadre()
342
  self.document.save(nom_fichier)
343
  return nom_fichier
 
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(".................................................................")
 
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