diff --git a/app/api/etudiants.py b/app/api/etudiants.py index 29132a99e..53f2ed3e5 100755 --- a/app/api/etudiants.py +++ b/app/api/etudiants.py @@ -399,7 +399,7 @@ def bulletin( formsemestre, etud, version=version, - format="pdf", + fmt="pdf", with_img_signatures_pdf=with_img_signatures_pdf, ) return pdf_response diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 452c0b254..494fe090b 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -515,7 +515,7 @@ class BulletinBUT: infos, _ = sco_bulletins.etud_descr_situation_semestre( etud.id, self.res.formsemestre, - format="html", + fmt="html", show_date_inscr=self.prefs["bul_show_date_inscr"], show_decisions=self.prefs["bul_show_decision"], show_uevalid=self.prefs["bul_show_uevalid"], diff --git a/app/but/bulletin_but_court_pdf.py b/app/but/bulletin_but_court_pdf.py index a657cf43a..9446d8479 100644 --- a/app/but/bulletin_but_court_pdf.py +++ b/app/but/bulletin_but_court_pdf.py @@ -50,7 +50,7 @@ def make_bulletin_but_court_pdf( try: PDFLOCK.acquire() bul_generator = BulletinGeneratorBUTCourt(**locals()) - bul_pdf = bul_generator.generate(format="pdf") + bul_pdf = bul_generator.generate(fmt="pdf") finally: PDFLOCK.release() return bul_pdf diff --git a/app/but/bulletin_but_pdf.py b/app/but/bulletin_but_pdf.py index 82750d206..dd3ec6870 100644 --- a/app/but/bulletin_but_pdf.py +++ b/app/but/bulletin_but_pdf.py @@ -14,7 +14,7 @@ La génération du bulletin PDF suit le chemin suivant: - sco_bulletins_generator.make_formsemestre_bulletin_etud() - instance de BulletinGeneratorStandardBUT -- BulletinGeneratorStandardBUT.generate(format="pdf") +- BulletinGeneratorStandardBUT.generate(fmt="pdf") sco_bulletins_generator.BulletinGenerator.generate() .generate_pdf() .bul_table() (ci-dessous) @@ -74,7 +74,7 @@ class BulletinGeneratorStandardBUT(BulletinGeneratorStandard): html_class_ignore_default=True, html_with_td_classes=True, ) - table_objects = table.gen(format=fmt) + table_objects = table.gen(fmt=fmt) objects += table_objects # objects += [KeepInFrame(0, 0, table_objects, mode="shrink")] if i != 2: diff --git a/app/but/bulletin_but_xml_compat.py b/app/but/bulletin_but_xml_compat.py index 75dade0a1..4ab940f7a 100644 --- a/app/but/bulletin_but_xml_compat.py +++ b/app/but/bulletin_but_xml_compat.py @@ -258,7 +258,7 @@ def bulletin_but_xml_compat( infos, dpv = sco_bulletins.etud_descr_situation_semestre( etudid, formsemestre, - format="xml", + fmt="xml", show_uevalid=sco_preferences.get_preference( "bul_show_uevalid", formsemestre_id ), diff --git a/app/but/jury_but_pv.py b/app/but/jury_but_pv.py index d0933c7a6..0b8dfd064 100644 --- a/app/but/jury_but_pv.py +++ b/app/but/jury_but_pv.py @@ -94,7 +94,7 @@ def pvjury_page_but(formsemestre_id: int, fmt="html"): }, xls_style_base=xls_style_base, ) - return tab.make_page(format=fmt, javascripts=["js/etud_info.js"], init_qtip=True) + return tab.make_page(fmt=fmt, javascripts=["js/etud_info.js"], init_qtip=True) def pvjury_table_but( diff --git a/app/scodoc/gen_tables.py b/app/scodoc/gen_tables.py index 7647f3e4c..8fcda8fb9 100644 --- a/app/scodoc/gen_tables.py +++ b/app/scodoc/gen_tables.py @@ -297,23 +297,23 @@ class GenTable: "list of titles" return [self.titles.get(cid, "") for cid in self.columns_ids] - def gen(self, format="html", columns_ids=None): + def gen(self, fmt="html", columns_ids=None): """Build representation of the table in the specified format. See make_page() for more sophisticated output. """ - if format == "html": + if fmt == "html": return self.html() - elif format == "xls" or format == "xlsx": + elif fmt == "xls" or fmt == "xlsx": return self.excel() - elif format == "text" or format == "csv": + elif fmt == "text" or fmt == "csv": return self.text() - elif format == "pdf": + elif fmt == "pdf": return self.pdf() - elif format == "xml": + elif fmt == "xml": return self.xml() - elif format == "json": + elif fmt == "json": return self.json() - raise ValueError(f"GenTable: invalid format: {format}") + raise ValueError(f"GenTable: invalid format: {fmt}") def _gen_html_row(self, row, line_num=0, elem="td", css_classes=""): "row is a dict, returns a string
. HTML does not allow logos.
+ If fmt = 'html', replaces . HTML does not allow logos.
"""
try:
# None values are mapped to empty strings by WrapDict
@@ -225,7 +225,7 @@ def get_formsemestre_bulletins_pdf(formsemestre_id, version="selectedevals"):
frag, _ = sco_bulletins.do_formsemestre_bulletinetud(
formsemestre,
etud,
- format="pdfpart",
+ fmt="pdfpart",
version=version,
)
fragments += frag
@@ -270,7 +270,7 @@ def get_etud_bulletins_pdf(etudid, version="selectedevals"):
frag, filigranne = sco_bulletins.do_formsemestre_bulletinetud(
formsemestre,
etud,
- format="pdfpart",
+ fmt="pdfpart",
version=version,
)
fragments += frag
diff --git a/app/scodoc/sco_bulletins_standard.py b/app/scodoc/sco_bulletins_standard.py
index e8dda75f0..ab49f8a8b 100644
--- a/app/scodoc/sco_bulletins_standard.py
+++ b/app/scodoc/sco_bulletins_standard.py
@@ -116,7 +116,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator):
html_with_td_classes=True,
)
- return T.gen(format=fmt)
+ return T.gen(fmt=fmt)
def bul_part_below(self, fmt="html"):
"""Génère les informations placées sous la table de notes
diff --git a/app/scodoc/sco_bulletins_xml.py b/app/scodoc/sco_bulletins_xml.py
index 3eafc5cab..58305f145 100644
--- a/app/scodoc/sco_bulletins_xml.py
+++ b/app/scodoc/sco_bulletins_xml.py
@@ -357,7 +357,7 @@ def make_xml_formsemestre_bulletinetud(
infos, dpv = sco_bulletins.etud_descr_situation_semestre(
etudid,
formsemestre,
- format="xml",
+ fmt="xml",
show_uevalid=sco_preferences.get_preference(
"bul_show_uevalid", formsemestre_id
),
diff --git a/app/scodoc/sco_cost_formation.py b/app/scodoc/sco_cost_formation.py
index 87937b5e1..f266b0638 100644
--- a/app/scodoc/sco_cost_formation.py
+++ b/app/scodoc/sco_cost_formation.py
@@ -152,7 +152,7 @@ def formsemestre_estim_cost(
n_group_tp=1,
coef_tp=1,
coef_cours=1.5,
- format="html",
+ fmt="html",
):
"""Page (formulaire) estimation coûts"""
@@ -192,4 +192,4 @@ def formsemestre_estim_cost(
coef_tp,
)
- return tab.make_page(format=format)
+ return tab.make_page(fmt=fmt)
diff --git a/app/scodoc/sco_debouche.py b/app/scodoc/sco_debouche.py
index 09ae1f5a5..c08a6e999 100644
--- a/app/scodoc/sco_debouche.py
+++ b/app/scodoc/sco_debouche.py
@@ -49,7 +49,7 @@ from app.scodoc import sco_etud
import sco_version
-def report_debouche_date(start_year=None, format="html"):
+def report_debouche_date(start_year=None, fmt="html"):
"""Rapport (table) pour les débouchés des étudiants sortis
à partir de l'année indiquée.
"""
@@ -63,7 +63,7 @@ def report_debouche_date(start_year=None, format="html"):
"Année invalide. Année de début de la recherche"
)
- if format == "xls":
+ if fmt == "xls":
keep_numeric = True # pas de conversion des notes en strings
else:
keep_numeric = False
@@ -81,7 +81,7 @@ def report_debouche_date(start_year=None, format="html"):
title=""" fichier maquette CSV brut (non rempli par ScoDoc)
Débouchés étudiants
""",
init_qtip=True,
javascripts=["js/etud_info.js"],
- format=format,
+ fmt=fmt,
with_html_headers=True,
)
@@ -276,7 +276,7 @@ def itemsuivi_suppress(itemsuivi_id):
return ("", 204)
-def itemsuivi_create(etudid, item_date=None, situation="", format=None):
+def itemsuivi_create(etudid, item_date=None, situation="", fmt=None):
"""Creation d'un item"""
if not sco_permissions_check.can_edit_suivi():
raise AccessDenied("Vous n'avez pas le droit d'effectuer cette opération !")
@@ -287,7 +287,7 @@ def itemsuivi_create(etudid, item_date=None, situation="", format=None):
logdb(cnx, method="itemsuivi_create", etudid=etudid)
log("created itemsuivi %s for %s" % (itemsuivi_id, etudid))
item = itemsuivi_get(cnx, itemsuivi_id)
- if format == "json":
+ if fmt == "json":
return scu.sendJSON(item)
return item
@@ -320,13 +320,13 @@ def itemsuivi_set_situation(object, value):
return situation or scu.IT_SITUATION_MISSING_STR
-def itemsuivi_list_etud(etudid, format=None):
+def itemsuivi_list_etud(etudid, fmt=None):
"""Liste des items pour cet étudiant, avec tags"""
cnx = ndb.GetDBConnexion()
items = _itemsuivi_list(cnx, {"etudid": etudid})
for it in items:
it["tags"] = ", ".join(itemsuivi_tag_list(it["itemsuivi_id"]))
- if format == "json":
+ if fmt == "json":
return scu.sendJSON(items)
return items
diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py
index 39360d5f8..80047fcd6 100644
--- a/app/scodoc/sco_edit_ue.py
+++ b/app/scodoc/sco_edit_ue.py
@@ -979,18 +979,18 @@ du programme" (menu "Semestre") si vous avez un semestre en cours);
Semestres courants de l'étape {etape_apo}
"""
@@ -575,7 +575,7 @@ def view_formsemestre_by_etape(etape_apo=None, format="html"):
""",
)
tab.base_url = "%s?etape_apo=%s" % (request.base_url, etape_apo or "")
- return tab.make_page(format=format)
+ return tab.make_page(fmt=fmt)
def sem_has_etape(sem, code_etape):
diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py
index 0f018d47b..1b46a0484 100755
--- a/app/scodoc/sco_formsemestre_status.py
+++ b/app/scodoc/sco_formsemestre_status.py
@@ -325,7 +325,7 @@ def formsemestre_status_menubar(formsemestre: FormSemestre) -> str:
"title": "Exporter table des étudiants",
"endpoint": "scolar.groups_view",
"args": {
- "format": "allxls",
+ "fmt": "allxls",
"group_ids": sco_groups.get_default_group(
formsemestre_id, fix_if_missing=True
),
@@ -787,7 +787,7 @@ def formsemestre_description_table(
def formsemestre_description(
- formsemestre_id, format="html", with_evals=False, with_parcours=False
+ formsemestre_id, fmt="html", with_evals=False, with_parcours=False
):
"""Description du semestre sous forme de table exportable
Liste des modules et de leurs coefficients
@@ -807,7 +807,7 @@ def formsemestre_description(
>indiquer les parcours BUT
"""
- return tab.make_page(format=format)
+ return tab.make_page(fmt=fmt)
# genere liste html pour accès aux groupes de ce semestre
diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py
index 8511ca692..6a4d77e84 100644
--- a/app/scodoc/sco_groups.py
+++ b/app/scodoc/sco_groups.py
@@ -516,7 +516,7 @@ def get_etud_groups_in_partition(partition_id):
return R
-def formsemestre_partition_list(formsemestre_id, format="xml"):
+def formsemestre_partition_list(formsemestre_id, fmt="xml"):
"""Get partitions and groups in this semestre
Supported formats: xml, json
"""
@@ -524,7 +524,7 @@ def formsemestre_partition_list(formsemestre_id, format="xml"):
# Ajoute les groupes
for p in partitions:
p["group"] = get_partition_groups(p)
- return scu.sendResult(partitions, name="partition", format=format)
+ return scu.sendResult(partitions, name="partition", fmt=fmt)
# Encore utilisé par groupmgr.js
diff --git a/app/scodoc/sco_groups_exports.py b/app/scodoc/sco_groups_exports.py
index d6f63ea07..232f4cc3c 100644
--- a/app/scodoc/sco_groups_exports.py
+++ b/app/scodoc/sco_groups_exports.py
@@ -60,7 +60,7 @@ def groups_list_annotation(group_ids: list[int]) -> list[dict]:
return annotations
-def groups_export_annotations(group_ids, formsemestre_id=None, format="html"):
+def groups_export_annotations(group_ids, formsemestre_id=None, fmt="html"):
"""Les annotations"""
groups_infos = sco_groups_view.DisplayedGroupsInfos(
group_ids, formsemestre_id=formsemestre_id
@@ -68,7 +68,7 @@ def groups_export_annotations(group_ids, formsemestre_id=None, format="html"):
annotations = groups_list_annotation(groups_infos.group_ids)
for annotation in annotations:
annotation["date_str"] = annotation["date"].strftime("%d/%m/%Y à %Hh%M")
- if format == "xls":
+ if fmt == "xls":
columns_ids = ("etudid", "nom", "prenom", "date", "comment")
else:
columns_ids = ("etudid", "nom", "prenom", "date_str", "comment")
@@ -93,4 +93,4 @@ def groups_export_annotations(group_ids, formsemestre_id=None, format="html"):
html_class="table_leftalign",
preferences=sco_preferences.SemPreferences(formsemestre_id),
)
- return table.make_page(format=format)
+ return table.make_page(fmt=fmt)
diff --git a/app/scodoc/sco_groups_view.py b/app/scodoc/sco_groups_view.py
index 794c4ba3d..835207735 100644
--- a/app/scodoc/sco_groups_view.py
+++ b/app/scodoc/sco_groups_view.py
@@ -70,7 +70,7 @@ CSSSTYLES = html_sco_header.BOOTSTRAP_MULTISELECT_CSS
# view:
def groups_view(
group_ids=(),
- format="html",
+ fmt="html",
# Options pour listes:
with_codes=0,
etat=None,
@@ -82,7 +82,7 @@ def groups_view(
):
"""Affichage des étudiants des groupes indiqués
group_ids: liste de group_id
- format: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf
+ fmt: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf
"""
# Informations sur les groupes à afficher:
groups_infos = DisplayedGroupsInfos(
@@ -92,10 +92,10 @@ def groups_view(
select_all_when_unspecified=True,
)
# Formats spéciaux: download direct
- if format != "html":
+ if fmt != "html":
return groups_table(
groups_infos=groups_infos,
- format=format,
+ fmt=fmt,
with_codes=with_codes,
etat=etat,
with_paiement=with_paiement,
@@ -135,7 +135,7 @@ def groups_view(
""",
groups_table(
groups_infos=groups_infos,
- format=format,
+ fmt=fmt,
with_codes=with_codes,
etat=etat,
with_paiement=with_paiement,
@@ -437,14 +437,14 @@ def groups_table(
groups_infos: DisplayedGroupsInfos = None,
with_codes=0,
etat=None,
- format="html",
+ fmt="html",
with_paiement=0, # si vrai, ajoute colonnes infos paiement droits et finalisation inscription (lent car interrogation portail)
with_archives=0, # ajoute colonne avec noms fichiers archivés
with_annotations=0,
with_bourse=0,
):
"""liste etudiants inscrits dans ce semestre
- format: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf
+ fmt: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf
Si with_codes, ajoute 4 colonnes avec les codes etudid, NIP, INE et etape
"""
from app.scodoc import sco_report
@@ -499,12 +499,12 @@ def groups_table(
p["partition_id"]: p["partition_name"] for p in groups_infos.partitions
}
- if format != "html": # ne mentionne l'état que en Excel (style en html)
+ if fmt != "html": # ne mentionne l'état que en Excel (style en html)
columns_ids.append("etat")
columns_ids.append("email")
columns_ids.append("emailperso")
- if format == "moodlecsv":
+ if fmt == "moodlecsv":
columns_ids = ["email", "semestre_groupe"]
if with_codes:
@@ -579,7 +579,7 @@ def groups_table(
else:
s = ""
- if format == "moodlecsv":
+ if fmt == "moodlecsv":
# de la forme S1-[FI][FA]-groupe.csv
if not moodle_groupenames:
moodle_groupenames = {"tous"}
@@ -612,7 +612,7 @@ def groups_table(
preferences=prefs,
)
#
- if format == "html":
+ if fmt == "html":
amail_inst = [
x["email"] for x in groups_infos.members if x["email"] and x["etat"] != "D"
]
@@ -683,11 +683,11 @@ def groups_table(
[
tab.html(),
"",
- '
Feuilles
",
'',
- """
Bordereau de Signatures (version PDF)',
+ f'
Bordereau de Signatures (version PDF)',
" \n",
@@ -670,7 +670,7 @@ def _add_eval_columns(
K,
note_sur_20,
keep_numeric,
- format="html",
+ fmt="html",
):
"""Add eval e"""
nb_notes = 0
@@ -774,7 +774,7 @@ def _add_eval_columns(
row_coefs[evaluation_id] = "coef. %s" % e["coefficient"]
if is_apc:
- if format == "html":
+ if fmt == "html":
row_poids[evaluation_id] = _mini_table_eval_ue_poids(
evaluation_id, evals_poids, ues
)
diff --git a/app/scodoc/sco_lycee.py b/app/scodoc/sco_lycee.py
index 4d9cf02fe..d3585cd1c 100644
--- a/app/scodoc/sco_lycee.py
+++ b/app/scodoc/sco_lycee.py
@@ -63,7 +63,7 @@ def formsemestre_table_etuds_lycees(
)
-def scodoc_table_etuds_lycees(format="html"):
+def scodoc_table_etuds_lycees(fmt="html"):
"""Table avec _tous_ les étudiants des semestres non verrouillés
de _tous_ les départements.
"""
@@ -71,7 +71,7 @@ def scodoc_table_etuds_lycees(format="html"):
semdepts = sco_formsemestre.scodoc_get_all_unlocked_sems()
etuds = []
try:
- for (sem, dept) in semdepts:
+ for sem, dept in semdepts:
app.set_sco_dept(dept.acronym)
etuds += sco_report.tsp_etud_list(sem["formsemestre_id"])[0]
finally:
@@ -85,8 +85,8 @@ def scodoc_table_etuds_lycees(format="html"):
no_links=True,
)
tab.base_url = request.base_url
- t = tab.make_page(format=format, with_html_headers=False)
- if format != "html":
+ t = tab.make_page(fmt=fmt, with_html_headers=False)
+ if fmt != "html":
return t
H = [
html_sco_header.sco_header(
@@ -178,7 +178,7 @@ def _table_etuds_lycees(etuds, group_lycees, title, preferences, no_links=False)
def formsemestre_etuds_lycees(
formsemestre_id,
- format="html",
+ fmt="html",
only_primo=False,
no_grouping=False,
):
@@ -191,14 +191,10 @@ def formsemestre_etuds_lycees(
tab.base_url += "&only_primo=1"
if no_grouping:
tab.base_url += "&no_grouping=1"
- t = tab.make_page(format=format, with_html_headers=False)
- if format != "html":
+ t = tab.make_page(fmt=fmt, with_html_headers=False)
+ if fmt != "html":
return t
- F = [
- sco_report.tsp_form_primo_group(
- only_primo, no_grouping, formsemestre_id, format
- )
- ]
+ F = [sco_report.tsp_form_primo_group(only_primo, no_grouping, formsemestre_id, fmt)]
H = [
html_sco_header.sco_header(
page_title=tab.page_title,
diff --git a/app/scodoc/sco_placement.py b/app/scodoc/sco_placement.py
index 3bc9c2a61..d0cc4ca1b 100644
--- a/app/scodoc/sco_placement.py
+++ b/app/scodoc/sco_placement.py
@@ -383,7 +383,7 @@ class PlacementRunner:
self.moduleimpl_data["formsemestre_id"]
),
)
- return tab.make_page(format="pdf", with_html_headers=False)
+ return tab.make_page(fmt="pdf", with_html_headers=False)
def _one_header(self, worksheet):
cells = [
diff --git a/app/scodoc/sco_poursuite_dut.py b/app/scodoc/sco_poursuite_dut.py
index 77c631e4e..428f60aec 100644
--- a/app/scodoc/sco_poursuite_dut.py
+++ b/app/scodoc/sco_poursuite_dut.py
@@ -178,7 +178,7 @@ def _getEtudInfoGroupes(group_ids, etat=None):
return etuds
-def formsemestre_poursuite_report(formsemestre_id, format="html"):
+def formsemestre_poursuite_report(formsemestre_id, fmt="html"):
"""Table avec informations "poursuite" """
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
etuds = _getEtudInfoGroupes([sco_groups.get_default_group(formsemestre_id)])
@@ -230,6 +230,6 @@ def formsemestre_poursuite_report(formsemestre_id, format="html"):
title="""Répartition des notes:
"
+ histo
+ "Poursuite d'études
""",
init_qtip=True,
javascripts=["js/etud_info.js"],
- format=format,
+ fmt=fmt,
with_html_headers=True,
)
diff --git a/app/scodoc/sco_pv_forms.py b/app/scodoc/sco_pv_forms.py
index 5b7be89e2..014a84228 100644
--- a/app/scodoc/sco_pv_forms.py
+++ b/app/scodoc/sco_pv_forms.py
@@ -206,14 +206,14 @@ def pvjury_table(
return lines, titles, columns_ids
-def formsemestre_pvjury(formsemestre_id, format="html", publish=True):
+def formsemestre_pvjury(formsemestre_id, fmt="html", publish=True):
"""Page récapitulant les décisions de jury
En classique: table spécifique avec les deux semestres pour le DUT
En APC/BUT: renvoie vers table recap, en mode jury.
"""
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
is_apc = formsemestre.formation.is_apc()
- if format == "html" and is_apc:
+ if fmt == "html" and is_apc:
return redirect(
url_for(
"notes.formsemestre_recapcomplet",
@@ -227,7 +227,7 @@ def formsemestre_pvjury(formsemestre_id, format="html", publish=True):
dpv = sco_pv_dict.dict_pvjury(formsemestre_id, with_prev=True)
if not dpv:
- if format == "html":
+ if fmt == "html":
return (
html_sco_header.sco_header()
+ "Aucune information disponible !
"
@@ -239,7 +239,7 @@ def formsemestre_pvjury(formsemestre_id, format="html", publish=True):
formsemestre_id = sem["formsemestre_id"]
rows, titles, columns_ids = pvjury_table(dpv)
- if format != "html" and format != "pdf":
+ if fmt != "html" and fmt != "pdf":
columns_ids = ["etudid", "code_nip"] + columns_ids
tab = GenTable(
@@ -255,9 +255,9 @@ def formsemestre_pvjury(formsemestre_id, format="html", publish=True):
html_sortable=True,
preferences=sco_preferences.SemPreferences(formsemestre_id),
)
- if format != "html":
+ if fmt != "html":
return tab.make_page(
- format=format,
+ fmt=fmt,
with_html_headers=False,
publish=publish,
)
diff --git a/app/scodoc/sco_report.py b/app/scodoc/sco_report.py
index 70bc7afe5..a558bce12 100644
--- a/app/scodoc/sco_report.py
+++ b/app/scodoc/sco_report.py
@@ -205,7 +205,7 @@ def _results_by_category(
bottom_titles["row_title"] = "Total"
# ajout titre ligne:
- for (cat, l) in zip(categories, C):
+ for cat, l in zip(categories, C):
l["row_title"] = cat if cat is not None else "?"
#
@@ -274,7 +274,7 @@ def formsemestre_report(
return tab
-# def formsemestre_report_bacs(formsemestre_id, format='html'):
+# def formsemestre_report_bacs(formsemestre_id, fmt='html'):
# """
# Tableau sur résultats par type de bac
# """
@@ -287,12 +287,12 @@ def formsemestre_report(
# title=title)
# return tab.make_page(
# title = """Résultats de %(titreannee)s
""" % sem,
-# format=format, page_title = title)
+# fmt=fmt, page_title = title)
def formsemestre_report_counts(
formsemestre_id: int,
- format="html",
+ fmt="html",
category: str = "bac",
result: str = None,
allkeys: bool = False,
@@ -397,10 +397,10 @@ def formsemestre_report_counts(
t = tab.make_page(
title="""Comptes croisés
""",
- format=format,
+ fmt=fmt,
with_html_headers=False,
)
- if format != "html":
+ if fmt != "html":
return t
H = [
html_sco_header.sco_header(page_title=title),
@@ -734,7 +734,7 @@ def table_suivi_cohorte(
def formsemestre_suivi_cohorte(
formsemestre_id,
- format="html",
+ fmt="html",
percent=1,
bac="",
bacspecialite="",
@@ -774,8 +774,8 @@ def formsemestre_suivi_cohorte(
)
if only_primo:
tab.base_url += "&only_primo=on"
- t = tab.make_page(format=format, with_html_headers=False)
- if format != "html":
+ t = tab.make_page(fmt=fmt, with_html_headers=False)
+ if fmt != "html":
return t
base_url = request.base_url
@@ -1246,7 +1246,7 @@ def table_suivi_cursus(formsemestre_id, only_primo=False, grouped_parcours=True)
return tab
-def tsp_form_primo_group(only_primo, no_grouping, formsemestre_id, format):
+def tsp_form_primo_group(only_primo, no_grouping, formsemestre_id, fmt):
"""Element de formulaire pour choisir si restriction aux primos entrants et groupement par lycees"""
F = ["""""")
return "\n".join(F)
def formsemestre_suivi_cursus(
formsemestre_id,
- format="html",
+ fmt="html",
only_primo=False,
no_grouping=False,
):
@@ -1290,10 +1290,10 @@ def formsemestre_suivi_cursus(
tab.base_url += "&only_primo=1"
if no_grouping:
tab.base_url += "&no_grouping=1"
- t = tab.make_page(format=format, with_html_headers=False)
- if format != "html":
+ t = tab.make_page(fmt=fmt, with_html_headers=False)
+ if fmt != "html":
return t
- F = [tsp_form_primo_group(only_primo, no_grouping, formsemestre_id, format)]
+ F = [tsp_form_primo_group(only_primo, no_grouping, formsemestre_id, fmt)]
H = [
html_sco_header.sco_header(
@@ -1312,7 +1312,7 @@ def formsemestre_suivi_cursus(
# -------------
def graph_cursus(
formsemestre_id,
- format="svg",
+ fmt="svg",
only_primo=False,
bac="", # selection sur type de bac
bacspecialite="",
@@ -1437,7 +1437,7 @@ def graph_cursus(
g.add_node(n)
g.set("rankdir", "LR") # left to right
g.set_fontname("Helvetica")
- if format == "svg":
+ if fmt == "svg":
g.set_bgcolor("#fffff0") # ou 'transparent'
# titres des semestres:
for s in sems.values():
@@ -1489,7 +1489,7 @@ def graph_cursus(
n.set("label", "Diplome") # bug si accent (pas compris pourquoi)
# Arètes:
bubbles = {} # substitue titres pour bulle aides: src_id:dst_id : etud_descr
- for (src_id, dst_id) in edges.keys():
+ for src_id, dst_id in edges.keys():
e = g.get_edge(src_id, dst_id)[0]
e.set("arrowhead", "normal")
e.set("arrowsize", 1)
@@ -1503,20 +1503,19 @@ def graph_cursus(
e.set_URL(f"__xxxetudlist__?{src_id}:{dst_id}")
# Genere graphe
_, path = tempfile.mkstemp(".gr")
- g.write(path=path, format=format)
+ g.write(path=path, format=fmt)
with open(path, "rb") as f:
data = f.read()
- log("dot generated %d bytes in %s format" % (len(data), format))
+ log("dot generated %d bytes in %s format" % (len(data), fmt))
if not data:
log("graph.to_string=%s" % g.to_string())
- raise ValueError(
- "Erreur lors de la génération du document au format %s" % format
- )
+ raise ValueError("Erreur lors de la génération du document au format %s" % fmt)
os.unlink(path)
- if format == "svg":
+ if fmt == "svg":
# dot génère un document XML complet, il faut enlever l'en-tête
data_str = data.decode("utf-8")
data = "