From be90a8d4872e36618144d4b4b208b1c45178ad7f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 20 Aug 2021 01:22:44 +0200 Subject: [PATCH] fixes pylint --- app/scodoc/pe_semestretag.py | 5 ++--- app/scodoc/sco_abs.py | 2 +- app/scodoc/sco_bulletins_generator.py | 6 ++---- app/scodoc/sco_formsemestre.py | 2 ++ app/scodoc/sco_semset.py | 4 +--- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/scodoc/pe_semestretag.py b/app/scodoc/pe_semestretag.py index 3f745e3d..314f30a1 100644 --- a/app/scodoc/pe_semestretag.py +++ b/app/scodoc/pe_semestretag.py @@ -159,9 +159,8 @@ class SemestreTag(pe_tagtable.TableTag): for modimpl in self.modimpls: modimpl_id = modimpl["moduleimpl_id"] - tags = sco_tag_module.module_tag_list( - self.context, modimpl["module_id"] - ) # liste des tags pour le modimpl concerné + # liste des tags pour le modimpl concerné: + tags = sco_tag_module.module_tag_list(modimpl["module_id"]) for ( tag diff --git a/app/scodoc/sco_abs.py b/app/scodoc/sco_abs.py index 24e03cd0..83c7ad46 100644 --- a/app/scodoc/sco_abs.py +++ b/app/scodoc/sco_abs.py @@ -477,7 +477,7 @@ def _get_abs_description(a, cursor=None): if a["moduleimpl_id"] and a["moduleimpl_id"] != "NULL": # Trouver le nom du module Mlist = sco_moduleimpl.do_moduleimpl_withmodule_list( - None, moduleimpl_id=a["moduleimpl_id"] + moduleimpl_id=a["moduleimpl_id"] ) if Mlist: M = Mlist[0] diff --git a/app/scodoc/sco_bulletins_generator.py b/app/scodoc/sco_bulletins_generator.py index c0aedbe5..fb8584bc 100644 --- a/app/scodoc/sco_bulletins_generator.py +++ b/app/scodoc/sco_bulletins_generator.py @@ -150,9 +150,7 @@ class BulletinGenerator(object): def get_filename(self): """Build a filename to be proposed to the web client""" - sem = sco_formsemestre.get_formsemestre( - self.context, self.infos["formsemestre_id"] - ) + sem = sco_formsemestre.get_formsemestre(self.infos["formsemestre_id"]) dt = time.strftime("%Y-%m-%d") filename = "bul-%s-%s-%s.pdf" % ( sem["titre_num"], @@ -214,7 +212,7 @@ class BulletinGenerator(object): return objects else: # Generation du document PDF - sem = sco_formsemestre.get_formsemestre(self.context, formsemestre_id) + sem = sco_formsemestre.get_formsemestre(formsemestre_id) report = io.BytesIO() # in-memory document, no disk file document = sco_pdf.BaseDocTemplate(report) document.addPageTemplates( diff --git a/app/scodoc/sco_formsemestre.py b/app/scodoc/sco_formsemestre.py index 551ee7fa..1196fa71 100644 --- a/app/scodoc/sco_formsemestre.py +++ b/app/scodoc/sco_formsemestre.py @@ -30,6 +30,8 @@ import time from operator import itemgetter +from flask import g + import app from app.models import Departement from app.scodoc import sco_codes_parcours diff --git a/app/scodoc/sco_semset.py b/app/scodoc/sco_semset.py index 3e7e2402..2f7d88dc 100644 --- a/app/scodoc/sco_semset.py +++ b/app/scodoc/sco_semset.py @@ -122,9 +122,7 @@ class SemSet(dict): """Load formsemestres""" self.sems = [] for formsemestre_id in self.formsemestre_ids: - self.sems.append( - sco_formsemestre.get_formsemestre(self.context, formsemestre_id) - ) + self.sems.append(sco_formsemestre.get_formsemestre(formsemestre_id)) if self.sems: self["date_debut"] = min([sem["date_debut_iso"] for sem in self.sems])