From 8c02c6ef7e9e1787e26f8de3165d96926d51d1df Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 29 Jul 2021 11:19:00 +0300 Subject: [PATCH] removed useless context arg from evaluations --- app/scodoc/gen_tables.py | 6 +- app/scodoc/html_sco_header.py | 15 +- app/scodoc/html_sidebar.py | 10 +- app/scodoc/notes_table.py | 2 +- app/scodoc/pe_jurype.py | 11 +- app/scodoc/pe_view.py | 2 +- app/scodoc/sco_abs_views.py | 20 +- app/scodoc/sco_apogee_compare.py | 4 +- app/scodoc/sco_archives.py | 6 +- app/scodoc/sco_archives_etud.py | 6 +- app/scodoc/sco_bulletins.py | 6 +- app/scodoc/sco_bulletins_generator.py | 4 +- app/scodoc/sco_bulletins_json.py | 2 +- app/scodoc/sco_bulletins_standard.py | 6 +- app/scodoc/sco_bulletins_xml.py | 2 +- app/scodoc/sco_compute_moy.py | 2 +- app/scodoc/sco_debouche.py | 2 +- app/scodoc/sco_dept.py | 2 +- app/scodoc/sco_dump_db.py | 2 +- app/scodoc/sco_edit_formation.py | 10 +- app/scodoc/sco_edit_matiere.py | 16 +- app/scodoc/sco_edit_module.py | 12 +- app/scodoc/sco_edit_ue.py | 8 +- app/scodoc/sco_edt_cal.py | 2 +- app/scodoc/sco_etape_apogee_view.py | 12 +- app/scodoc/sco_etud.py | 2 - app/scodoc/sco_evaluations.py | 204 +++++++++----------- app/scodoc/sco_export_results.py | 2 +- app/scodoc/sco_find_etud.py | 8 +- app/scodoc/sco_formations.py | 2 - app/scodoc/sco_formsemestre.py | 2 - app/scodoc/sco_formsemestre_custommenu.py | 4 +- app/scodoc/sco_formsemestre_edit.py | 26 +-- app/scodoc/sco_formsemestre_exterieurs.py | 4 +- app/scodoc/sco_formsemestre_inscriptions.py | 10 +- app/scodoc/sco_formsemestre_status.py | 10 +- app/scodoc/sco_formsemestre_validation.py | 18 +- app/scodoc/sco_groups.py | 14 +- app/scodoc/sco_groups_edit.py | 2 +- app/scodoc/sco_groups_view.py | 2 +- app/scodoc/sco_import_etuds.py | 6 +- app/scodoc/sco_inscr_passage.py | 2 +- app/scodoc/sco_liste_notes.py | 36 ++-- app/scodoc/sco_lycee.py | 4 +- app/scodoc/sco_moduleimpl_inscriptions.py | 4 +- app/scodoc/sco_moduleimpl_status.py | 9 +- app/scodoc/sco_news.py | 11 +- app/scodoc/sco_page_etud.py | 2 +- app/scodoc/sco_permissions_check.py | 10 +- app/scodoc/sco_placement.py | 14 +- app/scodoc/sco_preferences.py | 4 +- app/scodoc/sco_pvjury.py | 6 +- app/scodoc/sco_pvpdf.py | 2 +- app/scodoc/sco_recapcomplet.py | 10 +- app/scodoc/sco_report.py | 8 +- app/scodoc/sco_saisie_notes.py | 70 +++---- app/scodoc/sco_semset.py | 2 +- app/scodoc/sco_synchro_etuds.py | 4 +- app/scodoc/sco_trombino.py | 6 +- app/scodoc/sco_ue_external.py | 7 +- app/scodoc/sco_undo_notes.py | 6 +- app/scodoc/sco_users.py | 4 +- app/scodoc/sco_utils.py | 11 +- app/views/absences.py | 20 +- app/views/entreprises.py | 7 +- app/views/notes.py | 61 +++--- app/views/scolar.py | 34 ++-- app/views/users.py | 8 +- scodoc.py | 2 + scotests/test_billet.py | 35 ++-- tests/unit/test_caches.py | 4 +- 71 files changed, 383 insertions(+), 506 deletions(-) diff --git a/app/scodoc/gen_tables.py b/app/scodoc/gen_tables.py index fcca48af00..078017e8c1 100644 --- a/app/scodoc/gen_tables.py +++ b/app/scodoc/gen_tables.py @@ -639,7 +639,7 @@ class GenTable(object): H.append(html_title) H.append(self.html()) if with_html_headers: - H.append(html_sco_header.sco_footer(context, REQUEST)) + H.append(html_sco_header.sco_footer()) return "\n".join(H) elif format == "pdf": objects = self.pdf() @@ -700,7 +700,7 @@ class SeqGenTable(object): # ----- Exemple d'utilisation minimal. if __name__ == "__main__": - T = gen_tables.GenTable( + T = GenTable( rows=[{"nom": "Hélène", "age": 26}, {"nom": "Titi&çà§", "age": 21}], columns_ids=("nom", "age"), ) @@ -715,7 +715,7 @@ if __name__ == "__main__": from reportlab.platypus import KeepInFrame from app.scodoc import sco_preferences, sco_pdf - preferences = sco_preferences.SemPreferences(None) + preferences = sco_preferences.SemPreferences() T.preferences = preferences objects = T.gen(format="pdf") objects = [KeepInFrame(0, 0, objects, mode="shrink")] diff --git a/app/scodoc/html_sco_header.py b/app/scodoc/html_sco_header.py index 171b694c5d..2401ee7cb3 100644 --- a/app/scodoc/html_sco_header.py +++ b/app/scodoc/html_sco_header.py @@ -28,7 +28,7 @@ """HTML Header/Footer for ScoDoc pages """ -import cgi +import html from flask_login import current_user @@ -124,9 +124,9 @@ _HTML_BEGIN = """ """ -def scodoc_top_html_header(context, REQUEST, page_title="ScoDoc"): +def scodoc_top_html_header(page_title="ScoDoc: bienvenue"): H = [ - _HTML_BEGIN % {"page_title": "ScoDoc: bienvenue", "encoding": scu.SCO_ENCODING}, + _HTML_BEGIN % {"page_title": page_title, "encoding": scu.SCO_ENCODING}, _TOP_LEVEL_CSS, """""", scu.CUSTOM_HTML_HEADER_CNX, @@ -158,9 +158,8 @@ def sco_header( "Main HTML page header for ScoDoc" from app.scodoc.sco_formsemestre_status import formsemestre_page_title + context = None # XXX TODO à enlever #context # context est une instance de ZScolar. container est une instance qui "acquiert" ZScolar - if container: - context = container # je pense que cela suffit pour ce qu'on veut. # Add a HTTP header (can be used by Apache to log requests) if REQUEST.AUTHENTICATED_USER: @@ -308,7 +307,7 @@ def sco_header( H.append(scu.CUSTOM_HTML_HEADER) # if not no_side_bar: - H.append(html_sidebar.sidebar(context, REQUEST)) + H.append(html_sidebar.sidebar(REQUEST)) H.append("""
""") # # Barre menu semestre: @@ -327,7 +326,7 @@ def sco_header( ) # if head_message: - H.append('
' + cgi.escape(head_message) + "
") + H.append('
' + html.escape(head_message) + "
") # # div pour affichage messages temporaires H.append('
') @@ -335,7 +334,7 @@ def sco_header( return "".join(H) -def sco_footer(context, REQUEST=None): +def sco_footer(): """Main HTMl pages footer""" return ( """
""" + scu.CUSTOM_HTML_FOOTER + """""" diff --git a/app/scodoc/html_sidebar.py b/app/scodoc/html_sidebar.py index c041c69330..a172df4f02 100644 --- a/app/scodoc/html_sidebar.py +++ b/app/scodoc/html_sidebar.py @@ -35,7 +35,7 @@ from app.scodoc import sco_preferences from app.scodoc.sco_permissions import Permission -def sidebar_common(context, REQUEST=None): +def sidebar_common(REQUEST=None): "partie commune à toutes les sidebar" authuser = REQUEST.AUTHENTICATED_USER params = { @@ -50,7 +50,7 @@ def sidebar_common(context, REQUEST=None): 'ScoDoc 8', '
%(authuser)s
déconnexion
' % params, - sidebar_dept(context, REQUEST), + sidebar_dept(REQUEST), """

Scolarité

Semestres
Programmes
@@ -75,7 +75,7 @@ def sidebar_common(context, REQUEST=None): return "".join(H) -def sidebar(context, REQUEST=None): +def sidebar(REQUEST=None): "Main HTML page sidebar" # rewritten from legacy DTML code from app.scodoc import sco_abs @@ -86,7 +86,7 @@ def sidebar(context, REQUEST=None): "SCO_USER_MANUAL": scu.SCO_USER_MANUAL, } - H = ['