diff --git a/VERSION b/VERSION deleted file mode 100644 index 199afabd..00000000 --- a/VERSION +++ /dev/null @@ -1,2 +0,0 @@ -9.0.0-alpha - diff --git a/app/__init__.py b/app/__init__.py index ffaedae5..fd3cd26a 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -6,7 +6,7 @@ import os import sys import logging -from logging.handlers import SMTPHandler, RotatingFileHandler +from logging.handlers import SMTPHandler, TimedRotatingFileHandler from flask import request from flask import Flask @@ -22,6 +22,7 @@ from flask_moment import Moment from flask_caching import Cache from config import DevConfig +import sco_version db = SQLAlchemy() migrate = Migrate() @@ -96,7 +97,7 @@ def create_app(config_class=DevConfig): mailhost=(app.config["MAIL_SERVER"], app.config["MAIL_PORT"]), fromaddr="no-reply@" + app.config["MAIL_SERVER"], toaddrs=[app.config["ADMINS"]], - subject="ScoDoc8 Failure", + subject="ScoDoc Failure", credentials=auth, secure=secure, ) @@ -105,8 +106,10 @@ def create_app(config_class=DevConfig): if not os.path.exists("logs"): os.mkdir("logs") - file_handler = RotatingFileHandler( - "logs/scodoc.log", maxBytes=10240, backupCount=10 + file_handler = TimedRotatingFileHandler( + "/opt/scodoc-data/log/scodoc.log", + when="W6", # Sunday + backupCount=53, # 1 an de logs ) file_handler.setFormatter( logging.Formatter( @@ -117,7 +120,7 @@ def create_app(config_class=DevConfig): app.logger.addHandler(file_handler) app.logger.setLevel(logging.INFO) - app.logger.info("ScoDoc8 startup") + app.logger.info(f"{sco_version.SCONAME} {sco_version.SCOVERSION} startup") return app diff --git a/app/scodoc/html_sco_header.py b/app/scodoc/html_sco_header.py index 856c191e..82c33cf7 100644 --- a/app/scodoc/html_sco_header.py +++ b/app/scodoc/html_sco_header.py @@ -37,7 +37,7 @@ from flask_login import current_user import app.scodoc.sco_utils as scu from app.scodoc.notes_log import log from app.scodoc import html_sidebar -from app.scodoc import VERSION +import sco_version # Some constants: @@ -165,7 +165,7 @@ def sco_header( head_message = request.args.get("head_message", "") params = { - "page_title": page_title or VERSION.SCONAME, + "page_title": page_title or sco_version.SCONAME, "no_side_bar": no_side_bar, "ScoURL": scu.ScoURL(), "encoding": scu.SCO_ENCODING, diff --git a/app/scodoc/sco_bulletins_generator.py b/app/scodoc/sco_bulletins_generator.py index d2ecdddd..5a1bfa27 100644 --- a/app/scodoc/sco_bulletins_generator.py +++ b/app/scodoc/sco_bulletins_generator.py @@ -53,12 +53,12 @@ from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Frame, Page from reportlab.platypus import Table, TableStyle, Image, KeepInFrame from app.scodoc import sco_utils as scu -from app.scodoc import VERSION from app.scodoc.sco_exceptions import NoteProcessError from app.scodoc.notes_log import log from app.scodoc import sco_formsemestre from app.scodoc import sco_pdf from app.scodoc.sco_pdf import PDFLOCK +import sco_version # Liste des types des classes de générateurs de bulletins PDF: BULLETIN_CLASSES = collections.OrderedDict() @@ -217,7 +217,7 @@ class BulletinGenerator(object): sco_pdf.ScolarsPageTemplate( document, author="%s %s (E. Viennet) [%s]" - % (VERSION.SCONAME, VERSION.SCOVERSION, self.description), + % (sco_version.SCONAME, sco_version.SCOVERSION, self.description), title="Bulletin %s de %s" % (sem["titremois"], self.infos["etud"]["nomprenom"]), subject="Bulletin de note", diff --git a/app/scodoc/sco_bulletins_pdf.py b/app/scodoc/sco_bulletins_pdf.py index ff05f722..b24484d5 100644 --- a/app/scodoc/sco_bulletins_pdf.py +++ b/app/scodoc/sco_bulletins_pdf.py @@ -60,7 +60,6 @@ from reportlab.platypus.doctemplate import PageTemplate, BaseDocTemplate from flask import g, url_for -from app.scodoc import VERSION import app.scodoc.sco_utils as scu from app.scodoc.notes_log import log from app.scodoc import sco_cache @@ -68,6 +67,7 @@ from app.scodoc import sco_formsemestre from app.scodoc import sco_pdf from app.scodoc import sco_preferences from app.scodoc import sco_etud +import sco_version def pdfassemblebulletins( @@ -95,7 +95,7 @@ def pdfassemblebulletins( document.addPageTemplates( sco_pdf.ScolarsPageTemplate( document, - author="%s %s (E. Viennet)" % (VERSION.SCONAME, VERSION.SCOVERSION), + author="%s %s (E. Viennet)" % (sco_version.SCONAME, sco_version.SCOVERSION), title="Bulletin %s" % bul_title, subject="Bulletin de note", server_name=server_name, diff --git a/app/scodoc/sco_config.py b/app/scodoc/sco_config.py index dc74f4fa..df5eb922 100644 --- a/app/scodoc/sco_config.py +++ b/app/scodoc/sco_config.py @@ -49,7 +49,7 @@ CONFIG.LOGO_HEADER_HEIGHT = 28 # minute: Minute as a decimal number [00,59]. # # server_url: URL du serveur ScoDoc -# scodoc_name: le nom du logiciel (ScoDoc actuellement, voir VERSION.py) +# scodoc_name: le nom du logiciel (ScoDoc actuellement, voir sco_version.py) CONFIG.DEFAULT_PDF_FOOTER_TEMPLATE = "Edité par %(scodoc_name)s le %(day)s/%(month)s/%(year)s à %(hour)sh%(minute)s sur %(server_url)s" # diff --git a/app/scodoc/sco_cost_formation.py b/app/scodoc/sco_cost_formation.py index a2e532a2..f262a653 100644 --- a/app/scodoc/sco_cost_formation.py +++ b/app/scodoc/sco_cost_formation.py @@ -35,8 +35,8 @@ from app.scodoc.gen_tables import GenTable from app.scodoc import sco_formsemestre from app.scodoc import sco_moduleimpl from app.scodoc import sco_formsemestre_status -from app.scodoc import VERSION from app.scodoc import sco_preferences +import sco_version def formsemestre_table_estim_cost( @@ -141,7 +141,9 @@ def formsemestre_table_estim_cost( (dans ce cas, retoucher le tableau excel exporté). """, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", filename="EstimCout-S%s" % sem["semestre_id"], ) return tab diff --git a/app/scodoc/sco_debouche.py b/app/scodoc/sco_debouche.py index 274a8da9..45b9abdf 100644 --- a/app/scodoc/sco_debouche.py +++ b/app/scodoc/sco_debouche.py @@ -34,7 +34,6 @@ from flask import url_for, g import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb from app.scodoc.notes_log import log -from app.scodoc import VERSION from app.scodoc.sco_exceptions import AccessDenied from app.scodoc.scolog import logdb from app.scodoc.gen_tables import GenTable @@ -45,6 +44,7 @@ from app.scodoc import sco_permissions_check from app.scodoc import sco_preferences from app.scodoc import sco_tag_module from app.scodoc import sco_etud +import sco_version def report_debouche_date(start_year=None, format="html", REQUEST=None): @@ -60,7 +60,9 @@ def report_debouche_date(start_year=None, format="html", REQUEST=None): tab = table_debouche_etudids(etudids, keep_numeric=keep_numeric) tab.filename = scu.make_filename("debouche_scodoc_%s" % start_year) - tab.origin = "Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "" + tab.origin = ( + "Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr() + "" + ) tab.caption = "Récapitulatif débouchés à partir du 1/1/%s." % start_year tab.base_url = "%s?start_year=%s" % (REQUEST.URL0, start_year) return tab.make_page( diff --git a/app/scodoc/sco_dump_db.py b/app/scodoc/sco_dump_db.py index e9231f46..db9d4a5e 100644 --- a/app/scodoc/sco_dump_db.py +++ b/app/scodoc/sco_dump_db.py @@ -58,7 +58,7 @@ from app.scodoc.notes_log import log from app.scodoc import html_sco_header from app.scodoc import sco_preferences from app.scodoc import sco_users -from app.scodoc import VERSION +import sco_version from app.scodoc.sco_exceptions import ScoValueError SCO_DUMP_LOCK = "/tmp/scodump.lock" @@ -194,7 +194,7 @@ def _send_db(REQUEST, ano_db_name): "sent_by": sco_users.user_info(str(REQUEST.AUTHENTICATED_USER))[ "nomcomplet" ], - "sco_version": VERSION.SCOVERSION, + "sco_version": sco_version.SCOVERSION, "sco_fullversion": scu.get_scodoc_version(), }, ) diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index 7e8f01ae..66a8fe8c 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -1022,7 +1022,7 @@ def formation_table_recap(formation_id, format="html", REQUEST=None): columns_ids=columns_ids, rows=T, titles=titles, - origin="Généré par %s le " % scu.VERSION.SCONAME + origin="Généré par %s le " % scu.sco_version.SCONAME + scu.timedate_human_repr() + "", caption=title, diff --git a/app/scodoc/sco_emails.py b/app/scodoc/sco_emails.py index 017ffffd..a50db77f 100644 --- a/app/scodoc/sco_emails.py +++ b/app/scodoc/sco_emails.py @@ -45,7 +45,7 @@ import time import app.scodoc.sco_utils as scu from app.scodoc.notes_log import log -from app.scodoc import VERSION +import sco_version def sendEmail(msg): # TODO A REECRIRE ScoDoc8 @@ -124,7 +124,7 @@ def _report_request(REQUEST, fmt="txt"): HTTP_USER_AGENT=HTTP_USER_AGENT, form=REQUEST.form, HTTP_X_FORWARDED_FOR="?", - SCOVERSION=VERSION.SCOVERSION, + SCOVERSION=sco_version.SCOVERSION, ) txt = ( """ diff --git a/app/scodoc/sco_evaluations.py b/app/scodoc/sco_evaluations.py index caacf79f..59e5d264 100644 --- a/app/scodoc/sco_evaluations.py +++ b/app/scodoc/sco_evaluations.py @@ -42,7 +42,7 @@ from app.scodoc.notes_log import log, logCallStack import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb from app.scodoc.sco_exceptions import AccessDenied, ScoValueError -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable from app.scodoc.TrivialFormulator import TrivialFormulator from app.scodoc import html_sco_header @@ -915,7 +915,9 @@ def formsemestre_evaluations_delai_correction( caption="Correction des évaluations du semestre", preferences=sco_preferences.SemPreferences(formsemestre_id), base_url="%s?formsemestre_id=%s" % (REQUEST.URL0, formsemestre_id), - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", filename=scu.make_filename("evaluations_delais_" + sem["titreannee"]), ) return tab.make_page(format=format, REQUEST=REQUEST) diff --git a/app/scodoc/sco_export_results.py b/app/scodoc/sco_export_results.py index 12e1e8aa..e0636b49 100644 --- a/app/scodoc/sco_export_results.py +++ b/app/scodoc/sco_export_results.py @@ -40,7 +40,7 @@ from app.scodoc import sco_formations from app.scodoc import sco_preferences from app.scodoc import sco_pvjury from app.scodoc import sco_etud -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable from app.scodoc.sco_codes_parcours import NO_SEMESTRE_ID @@ -99,7 +99,9 @@ def _build_results_table(start_date=None, end_date=None, types_parcours=[]): columns_ids=columns_ids, filename=scu.make_filename("scodoc-results-%s-%s" % (start_date, end_date)), caption="Résultats ScoDoc de %s à %s" % (start_date, end_date), - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", html_class="table_leftalign", html_sortable=True, preferences=sco_preferences.SemPreferences(), diff --git a/app/scodoc/sco_formations.py b/app/scodoc/sco_formations.py index 83348d8f..e18ad011 100644 --- a/app/scodoc/sco_formations.py +++ b/app/scodoc/sco_formations.py @@ -46,7 +46,7 @@ from app.scodoc import sco_news from app.scodoc import sco_preferences from app.scodoc import sco_tag_module from app.scodoc import sco_xml -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable from app.scodoc.sco_exceptions import ScoValueError from app.scodoc.sco_permissions import Permission @@ -338,7 +338,9 @@ def formation_list_table(formation_id=None, args={}, REQUEST=None): columns_ids=columns_ids, rows=formations, titles=titles, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", caption=title, html_caption=title, table_id="formation_list_table", diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 837cc807..99c8f3b1 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -39,7 +39,7 @@ import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb from app.scodoc.sco_permissions import Permission from app.scodoc.sco_exceptions import ScoValueError, ScoInvalidDateError -from app.scodoc import VERSION +import sco_version from app.scodoc import html_sco_header from app.scodoc import htmlutils from app.scodoc import sco_abs @@ -697,7 +697,9 @@ def formsemestre_description_table(formsemestre_id, REQUEST=None, with_evals=Fal columns_ids=columns_ids, rows=R, titles=titles, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", caption=title, html_caption=title, html_class="table_leftalign formsemestre_description", diff --git a/app/scodoc/sco_liste_notes.py b/app/scodoc/sco_liste_notes.py index 0f34772b..ddb8a0ed 100644 --- a/app/scodoc/sco_liste_notes.py +++ b/app/scodoc/sco_liste_notes.py @@ -50,7 +50,7 @@ from app.scodoc import sco_groups from app.scodoc import sco_moduleimpl from app.scodoc import sco_preferences from app.scodoc import sco_etud -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable from app.scodoc.htmlutils import histogram_notes @@ -472,7 +472,9 @@ def _make_table_notes( html_sortable=True, base_url=base_url, filename=filename, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", caption=caption, html_next_section=html_next_section, page_title="Notes de " + sem["titremois"], diff --git a/app/scodoc/sco_lycee.py b/app/scodoc/sco_lycee.py index e671ca39..677738f7 100644 --- a/app/scodoc/sco_lycee.py +++ b/app/scodoc/sco_lycee.py @@ -40,7 +40,7 @@ from app.scodoc import sco_formsemestre from app.scodoc import sco_preferences from app.scodoc import sco_report from app.scodoc import sco_etud -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable @@ -163,7 +163,9 @@ def _table_etuds_lycees(etuds, group_lycees, title, preferences, no_links=False) "nomlycee": "Lycée", "villelycee": "Commune", }, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", caption=title, page_title="Carte lycées d'origine", html_sortable=True, diff --git a/app/scodoc/sco_pdf.py b/app/scodoc/sco_pdf.py index 7b219e85..574fb839 100755 --- a/app/scodoc/sco_pdf.py +++ b/app/scodoc/sco_pdf.py @@ -62,8 +62,7 @@ from app.scodoc.sco_utils import ( ) from app.scodoc.notes_log import log from app.scodoc.sco_exceptions import ScoGenError -from app.scodoc import VERSION -from .VERSION import SCOVERSION, SCONAME +import sco_version import six PAGE_HEIGHT = defaultPageSize[1] @@ -281,7 +280,7 @@ class ScolarsPageTemplate(PageTemplate): self.preferences["SCOLAR_FONT"], self.preferences["SCOLAR_FONT_SIZE_FOOT"] ) d = _makeTimeDict() - d["scodoc_name"] = VERSION.SCONAME + d["scodoc_name"] = sco_version.SCONAME d["server_url"] = self.server_name footer_str = SU(self.footer_template % d) canvas.drawString( @@ -319,7 +318,7 @@ def pdf_basic_page( ScolarsPageTemplate( document, title=title, - author="%s %s (E. Viennet)" % (SCONAME, SCOVERSION), + author="%s %s (E. Viennet)" % (sco_version.SCONAME, sco_version.SCOVERSION), footer_template="Edité par %(scodoc_name)s le %(day)s/%(month)s/%(year)s à %(hour)sh%(minute)s", preferences=preferences, ) diff --git a/app/scodoc/sco_placement.py b/app/scodoc/sco_placement.py index 0125743a..d3a9675e 100644 --- a/app/scodoc/sco_placement.py +++ b/app/scodoc/sco_placement.py @@ -52,7 +52,7 @@ from app.scodoc import sco_permissions_check from app.scodoc import sco_preferences from app.scodoc import sco_saisie_notes from app.scodoc import sco_etud -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable from app.scodoc.sco_excel import * # XXX à vérifier from app.scodoc.TrivialFormulator import TrivialFormulator @@ -387,7 +387,7 @@ def do_placement(REQUEST): columns_ids=columns_ids, rows=rows, filename=filename, - origin="Généré par %s le " % VERSION.SCONAME + origin="Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr() + "", pdf_title=pdf_title, diff --git a/app/scodoc/sco_poursuite_dut.py b/app/scodoc/sco_poursuite_dut.py index cabdd84a..bbc39e1e 100644 --- a/app/scodoc/sco_poursuite_dut.py +++ b/app/scodoc/sco_poursuite_dut.py @@ -40,7 +40,7 @@ from app.scodoc import sco_formsemestre from app.scodoc import sco_groups from app.scodoc import sco_preferences from app.scodoc import sco_etud -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable from app.scodoc.sco_codes_parcours import code_semestre_validant, code_semestre_attente @@ -206,7 +206,9 @@ def formsemestre_poursuite_report(formsemestre_id, format="html", REQUEST=None): ) tab.filename = scu.make_filename("poursuite " + sem["titreannee"]) - tab.origin = "Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "" + tab.origin = ( + "Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr() + "" + ) tab.caption = "Récapitulatif %s." % sem["titreannee"] tab.html_caption = "Récapitulatif %s." % sem["titreannee"] tab.base_url = "%s?formsemestre_id=%s" % (REQUEST.URL0, formsemestre_id) diff --git a/app/scodoc/sco_prepajury.py b/app/scodoc/sco_prepajury.py index 30c5b62d..f1f20c1e 100644 --- a/app/scodoc/sco_prepajury.py +++ b/app/scodoc/sco_prepajury.py @@ -37,7 +37,7 @@ from app.scodoc import sco_excel from app.scodoc import sco_formsemestre from app.scodoc import sco_parcours_dut from app.scodoc import sco_codes_parcours -from app.scodoc import VERSION +import sco_version from app.scodoc import sco_etud from app.scodoc import sco_preferences from app.scodoc.sco_excel import ScoExcelSheet @@ -312,7 +312,7 @@ def feuille_preparation_jury(formsemestre_id, REQUEST): ws.append_single_cell_row( "Préparé par %s le %s sur %s pour %s" % ( - VERSION.SCONAME, + sco_version.SCONAME, time.strftime("%d/%m/%Y"), REQUEST.BASE0, REQUEST.AUTHENTICATED_USER, diff --git a/app/scodoc/sco_pvjury.py b/app/scodoc/sco_pvjury.py index 9c2c5960..0b15d5a1 100644 --- a/app/scodoc/sco_pvjury.py +++ b/app/scodoc/sco_pvjury.py @@ -523,7 +523,7 @@ def formsemestre_pvjury(formsemestre_id, format="html", publish=True, REQUEST=No titles=titles, columns_ids=columns_ids, filename=scu.make_filename("decisions " + sem["titreannee"]), - origin="Généré par %s le " % scu.VERSION.SCONAME + origin="Généré par %s le " % scu.sco_version.SCONAME + scu.timedate_human_repr() + "", caption="Décisions jury pour " + sem["titreannee"], diff --git a/app/scodoc/sco_pvpdf.py b/app/scodoc/sco_pvpdf.py index 262d7750..b81c48d2 100644 --- a/app/scodoc/sco_pvpdf.py +++ b/app/scodoc/sco_pvpdf.py @@ -49,7 +49,7 @@ from app.scodoc import sco_formsemestre from app.scodoc import sco_pdf from app.scodoc import sco_preferences from app.scodoc import sco_etud -from app.scodoc import VERSION +import sco_version from app.scodoc.sco_pdf import PDFLOCK from app.scodoc.sco_pdf import SU @@ -384,7 +384,7 @@ def pdf_lettres_individuelles( document.addPageTemplates( CourrierIndividuelTemplate( document, - author="%s %s (E. Viennet)" % (VERSION.SCONAME, VERSION.SCOVERSION), + author="%s %s (E. Viennet)" % (sco_version.SCONAME, sco_version.SCOVERSION), title="Lettres décision %s" % sem["titreannee"], subject="Décision jury", margins=margins, @@ -655,7 +655,7 @@ def pvjury_pdf( document.addPageTemplates( PVTemplate( document, - author="%s %s (E. Viennet)" % (VERSION.SCONAME, VERSION.SCOVERSION), + author="%s %s (E. Viennet)" % (sco_version.SCONAME, sco_version.SCOVERSION), title=SU("PV du jury de %s" % sem["titre_num"]), subject="PV jury", preferences=sco_preferences.SemPreferences(formsemestre_id), diff --git a/app/scodoc/sco_report.py b/app/scodoc/sco_report.py index 31f36a37..f386a608 100644 --- a/app/scodoc/sco_report.py +++ b/app/scodoc/sco_report.py @@ -54,7 +54,7 @@ from app.scodoc import sco_formsemestre_status from app.scodoc import sco_parcours_dut from app.scodoc import sco_pdf from app.scodoc import sco_preferences -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable from app.scodoc.notes_log import log from app.scodoc.sco_codes_parcours import code_semestre_validant @@ -239,7 +239,9 @@ def formsemestre_report( # tab.filename = scu.make_filename("stats " + sem["titreannee"]) - tab.origin = "Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "" + tab.origin = ( + "Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr() + "" + ) tab.caption = "Répartition des résultats par %s, semestre %s" % ( category_name, sem["titreannee"], @@ -644,7 +646,9 @@ def table_suivi_cohorte( html_col_width="4em", html_sortable=True, filename=scu.make_filename("cohorte " + sem["titreannee"]), - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", caption="Suivi cohorte " + pp + sem["titreannee"] + dbac, page_title="Suivi cohorte " + sem["titreannee"], html_class="table_cohorte", @@ -1134,7 +1138,9 @@ def table_suivi_parcours(formsemestre_id, only_primo=False, grouped_parcours=Tru columns_ids=columns_ids, rows=L, titles=titles, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", caption="Parcours suivis, étudiants %s semestre " % primostr + sem["titreannee"], page_title="Parcours " + sem["titreannee"], diff --git a/app/scodoc/sco_undo_notes.py b/app/scodoc/sco_undo_notes.py index 2a34b0bd..6afa68c0 100644 --- a/app/scodoc/sco_undo_notes.py +++ b/app/scodoc/sco_undo_notes.py @@ -55,7 +55,7 @@ from app.scodoc import sco_formsemestre from app.scodoc import sco_moduleimpl from app.scodoc import sco_preferences from app.scodoc import sco_users -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable # deux notes (de même uid) sont considérées comme de la même opération si @@ -218,7 +218,9 @@ def formsemestre_list_saisies_notes(formsemestre_id, format="html", REQUEST=None caption="Saisies de notes dans %s" % sem["titreannee"], preferences=sco_preferences.SemPreferences(formsemestre_id), base_url="%s?formsemestre_id=%s" % (REQUEST.URL0, formsemestre_id), - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "", + origin="Généré par %s le " % sco_version.SCONAME + + scu.timedate_human_repr() + + "", ) return tab.make_page(format=format, REQUEST=REQUEST) diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index ec6b492f..72aba2be 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -63,7 +63,7 @@ from app.scodoc.sco_xml import quote_xml_attr from app.scodoc.sco_codes_parcours import NOTES_TOLERANCE, CODES_EXPL from app.scodoc import sco_exceptions from app.scodoc import sco_xml -from app.scodoc import VERSION +import sco_version # ----- CALCUL ET PRESENTATION DES NOTES diff --git a/app/views/entreprises.py b/app/views/entreprises.py index d0d76cf3..33c712f0 100644 --- a/app/views/entreprises.py +++ b/app/views/entreprises.py @@ -47,7 +47,6 @@ import calendar # from sco_utils import SCO_ENCODING # import app.scodoc.sco_utils as scu # import html_sidebar -# import VERSION # from app.scodoc.gen_tables import GenTable # from app.scodoc.TrivialFormulator import TrivialFormulator, TF # import sco_etud @@ -212,7 +211,7 @@ def index_html(REQUEST=None, etud_nom=None, limit=50, offset="", format="html"): "nbcorr": "Corresp.", "contacts": "Contacts", }, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr(), + origin="Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr(), filename=scu.make_filename( "entreprises_%s" % context.get_preference("DeptName") ), @@ -288,7 +287,7 @@ def entreprise_contact_list(entreprise_id=None, format="html", REQUEST=None): "etudnom": "Étudiant", "description": "Description", }, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr(), + origin="Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr(), filename=scu.make_filename("contacts_%s" % context.get_preference("DeptName")), caption="", html_sortable=True, @@ -392,7 +391,7 @@ def entreprise_correspondant_list( "modifier": "", "supprimer": "", }, - origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr(), + origin="Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr(), filename=scu.make_filename( "correspondants_%s_%s" % (E["nom"], context.get_preference("DeptName")) ), diff --git a/app/views/notes.py b/app/views/notes.py index b66e198a..694b04ab 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -133,7 +133,6 @@ from app.scodoc.gen_tables import GenTable from app.scodoc.sco_pdf import PDFLOCK from app.scodoc.sco_permissions import Permission from app.scodoc.TrivialFormulator import TrivialFormulator -import app.scodoc.VERSION as VERSION def sco_publish(route, function, permission, methods=["GET"]): diff --git a/app/views/scodoc.py b/app/views/scodoc.py index 90f5250b..4e97aa2c 100644 --- a/app/views/scodoc.py +++ b/app/views/scodoc.py @@ -36,7 +36,7 @@ from flask import request from flask_login.utils import login_required from app.models import Departement -from app.scodoc import VERSION +import sco_version from app.scodoc import sco_find_etud from app.scodoc.sco_permissions import Permission from app.views import scodoc_bp as bp @@ -50,7 +50,7 @@ def index(): depts = Departement.query.filter_by(visible=True).all() return render_template( "scodoc.html", - title=VERSION.SCONAME, + title=sco_version.SCONAME, current_app=flask.current_app, depts=depts, Permission=Permission, diff --git a/app/views/scolar.py b/app/views/scolar.py index 94777dd1..6c4aa4cc 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -71,7 +71,7 @@ from app.scodoc.sco_exceptions import ( ScoInvalidDept, ) from app.scodoc.TrivialFormulator import TrivialFormulator, tf_error_message -from app.scodoc import VERSION +import sco_version from app.scodoc.gen_tables import GenTable from app.scodoc import html_sco_header @@ -146,7 +146,7 @@ def about(REQUEST): H.append( '
Logiciel libre écrit en Python.
' ) - H.append("