From 678959c76a070c4569654c3ae546baf3540fb409 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 4 Oct 2022 21:55:43 +0200 Subject: [PATCH] code cleaning --- app/scodoc/sco_abs_views.py | 24 ++++++++++++++---------- app/views/absences.py | 32 ++++++++++++++++++++++---------- sco_version.py | 2 +- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/app/scodoc/sco_abs_views.py b/app/scodoc/sco_abs_views.py index 98faeb51..2ec44393 100644 --- a/app/scodoc/sco_abs_views.py +++ b/app/scodoc/sco_abs_views.py @@ -112,9 +112,9 @@ def doSignaleAbsence( nbadded += 1 # if estjust: - J = "" + just_str = "" else: - J = "NON " + just_str = "NON " indication_module = "" if moduleimpl_id and moduleimpl_id != "NULL": mod = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id)[0] @@ -137,31 +137,35 @@ def doSignaleAbsence( ] if dates: H.append( - """

Ajout de %d absences %sjustifiées du %s au %s %s

""" - % (nbadded, J, datedebut, datefin, indication_module) + f"""

Ajout de {nbadded} absences {just_str}justifiées + du {datedebut} au {datefin} {indication_module} +

+ """ ) else: H.append( - """

Aucune date ouvrable entre le %s et le %s !

""" - % (datedebut, datefin) + f"""

Aucune date ouvrable + entre le {datedebut} et le {datefin} ! +

+ """ ) H.append( f"""
+ {sco_find_etud.form_search_etud()} + {html_sco_header.sco_footer()} """ ) - H.append(sco_find_etud.form_search_etud()) - H.append(html_sco_header.sco_footer()) return "\n".join(H) diff --git a/app/views/absences.py b/app/views/absences.py index d076fe78..5dbda369 100644 --- a/app/views/absences.py +++ b/app/views/absences.py @@ -1036,11 +1036,14 @@ def EtatAbsencesDate(group_ids=[], date=None): # list of groups to display t_nbabsam = 0 t_nbabsjustpm = 0 t_nbabspm = 0 - H.append("

État des absences le %s

" % date) + H.append(f"

État des absences le {date}

") H.append( """ - - + + + + + """ ) for etud in groups_infos.members: @@ -1059,10 +1062,15 @@ def EtatAbsencesDate(group_ids=[], date=None): # list of groups to display etudid=etud["etudid"], debut=dateiso, fin=dateiso, matin=0 ) H.append( - """ + + ") H.append( - """""" - % (t_nbabsam, t_nbabsjustam, t_nbabspm, t_nbabsjustpm) + f""" + + + + +
 MatinAprès-midi
 MatinAprès-midi
- %(nomprenom)s""" - % etud - ) # """ + f"""
+ {etud["nomprenom"]} + + """ + ) if nbabsam != 0: if nbabsjustam: H.append("Just.") @@ -1084,10 +1092,14 @@ def EtatAbsencesDate(group_ids=[], date=None): # list of groups to display H.append("") H.append("
%d abs, %d just.%d abs, %d just.
{t_nbabsam} abs, {t_nbabsjustam} just.{t_nbabspm} abs, {t_nbabsjustpm} just.
+ """ ) - H.append("") if nbetud == 0: H.append("

Aucune absence !

") else: diff --git a/sco_version.py b/sco_version.py index 82c30e9a..3c7e89b8 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.3.52" +SCOVERSION = "9.3.53" SCONAME = "ScoDoc"