From 09a65b48ef7d4119b0a3681e19a85c11f8cbca61 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 13 Jun 2021 19:12:20 +0200 Subject: [PATCH] WIP refactoring: preferences --- README.md | 17 ++---- app/scodoc/ImportScolars.py | 10 ++-- app/scodoc/html_sidebar.py | 8 +-- app/scodoc/notes_log.py | 2 +- app/scodoc/notes_table.py | 2 +- app/scodoc/pe_avislatex.py | 4 +- app/scodoc/pe_view.py | 6 ++- app/scodoc/sco_abs.py | 2 +- app/scodoc/sco_abs_notification.py | 10 ++-- app/scodoc/sco_abs_views.py | 63 +++++++++++++++-------- app/scodoc/sco_apogee_compare.py | 12 +++-- app/scodoc/sco_bulletins.py | 31 +++++------ app/scodoc/sco_bulletins_generator.py | 10 ++-- app/scodoc/sco_bulletins_json.py | 14 ++--- app/scodoc/sco_bulletins_legacy.py | 20 +++---- app/scodoc/sco_bulletins_pdf.py | 14 ++--- app/scodoc/sco_bulletins_standard.py | 4 +- app/scodoc/sco_bulletins_ucac.py | 4 +- app/scodoc/sco_bulletins_xml.py | 14 ++--- app/scodoc/sco_cost_formation.py | 11 ++-- app/scodoc/sco_debouche.py | 4 +- app/scodoc/sco_dept.py | 12 +++-- app/scodoc/sco_dump_db.py | 2 +- app/scodoc/sco_edit_matiere.py | 31 +++++++++-- app/scodoc/sco_edit_ue.py | 31 ++++++----- app/scodoc/sco_edt_cal.py | 4 +- app/scodoc/sco_etape_apogee_view.py | 42 +++++++++++---- app/scodoc/sco_evaluations.py | 19 +++++-- app/scodoc/sco_excel.py | 2 +- app/scodoc/sco_export_results.py | 7 ++- app/scodoc/sco_find_etud.py | 15 ++++-- app/scodoc/sco_formations.py | 4 +- app/scodoc/sco_formsemestre.py | 8 ++- app/scodoc/sco_formsemestre_edit.py | 35 ++++++++----- app/scodoc/sco_formsemestre_status.py | 26 +++++----- app/scodoc/sco_formsemestre_validation.py | 2 +- app/scodoc/sco_groups_view.py | 12 +++-- app/scodoc/sco_import_users.py | 2 +- app/scodoc/sco_inscr_passage.py | 12 +++-- app/scodoc/sco_liste_notes.py | 17 +++--- app/scodoc/sco_lycee.py | 16 ++++-- app/scodoc/sco_news.py | 2 +- app/scodoc/sco_photos.py | 2 +- app/scodoc/sco_placement.py | 4 +- app/scodoc/sco_portal_apogee.py | 28 +++++----- app/scodoc/sco_poursuite_dut.py | 2 +- app/scodoc/sco_preferences.py | 27 +++++++--- app/scodoc/sco_prepajury.py | 8 +-- app/scodoc/sco_pvjury.py | 23 +++++---- app/scodoc/sco_pvpdf.py | 48 ++++++++--------- app/scodoc/sco_recapcomplet.py | 6 +-- app/scodoc/sco_report.py | 12 +++-- app/scodoc/sco_semset.py | 7 ++- app/scodoc/sco_trombino.py | 12 +++-- app/scodoc/sco_trombino_tours.py | 40 ++++++++------ app/scodoc/sco_undo_notes.py | 4 +- app/scodoc/sco_utils.py | 6 ++- app/scodoc/scolars.py | 6 +-- app/views/absences.py | 12 +++-- app/views/notes.py | 6 ++- app/views/scolar.py | 14 ++--- scotests/test-all-moys.py | 4 +- 62 files changed, 511 insertions(+), 323 deletions(-) diff --git a/README.md b/README.md index 73488544..48336d5d 100644 --- a/README.md +++ b/README.md @@ -55,20 +55,9 @@ Installer le bon vieux `pyExcelerator` dans l'environnement: ## Migration ZScolar ### Méthodes qui ne devraient plus être publiées: -security.declareProtected(ScoView, "get_preferences") - -def get_preferences(context, formsemestre_id=None): - "Get preferences for this instance (a dict-like instance)" - return sco_preferences.sem_preferences(context, formsemestre_id) - -security.declareProtected(ScoView, "get_preference") - -def get_preference(context, name, formsemestre_id=None): - """Returns value of named preference. - All preferences have a sensible default value (see sco_preferences.py), - this function always returns a usable value for all defined preferences names. - """ - return sco_preferences.get_base_preferences(context).get(formsemestre_id, name) + + + diff --git a/app/scodoc/ImportScolars.py b/app/scodoc/ImportScolars.py index 1935701f..701ede72 100644 --- a/app/scodoc/ImportScolars.py +++ b/app/scodoc/ImportScolars.py @@ -240,7 +240,9 @@ def students_import_excel( dest = "formsemestre_status?formsemestre_id=%s" % formsemestre_id else: dest = context.NotesURL() - H = [html_sco_header.sco_header(context, REQUEST, page_title="Import etudiants")] + H = [ + html_sco_header.sco_header(context, REQUEST, page_title="Import etudiants") + ] H.append("