fix des diff avec le master

This commit is contained in:
leonard_montalbano 2022-07-08 15:11:45 +02:00
parent 8b3c0ea414
commit 0db3acf271
4 changed files with 11 additions and 21 deletions

View File

@ -132,13 +132,10 @@ class BulletinGeneratorLegacy(sco_bulletins_generator.BulletinGenerator):
if sco_preferences.get_preference( if sco_preferences.get_preference(
"bul_show_minmax_mod", formsemestre_id "bul_show_minmax_mod", formsemestre_id
): ):
rang_minmax = ( rang_minmax = '%s <span class="bul_minmax" title="[min, max] UE">[%s, %s]</span>' % (
'%s <span class="bul_minmax" title="[min, max] UE">[%s, %s]</span>' mod["mod_rang_txt"],
% ( scu.fmt_note(mod["stats"]["min"]),
mod["mod_rang_txt"], scu.fmt_note(mod["stats"]["max"]),
scu.fmt_note(mod["stats"]["min"]),
scu.fmt_note(mod["stats"]["max"]),
)
) )
else: else:
rang_minmax = mod["mod_rang_txt"] # vide si pas option rang rang_minmax = mod["mod_rang_txt"] # vide si pas option rang

View File

@ -75,7 +75,7 @@ import sco_version
def assemble_bulletins_pdf( def assemble_bulletins_pdf(
formsemestre_id: int, formsemestre_id: int,
story, story: list,
bul_title: str, bul_title: str,
infos, infos,
pagesbookmarks=None, pagesbookmarks=None,
@ -107,7 +107,7 @@ def assemble_bulletins_pdf(
preferences=sco_preferences.SemPreferences(formsemestre_id), preferences=sco_preferences.SemPreferences(formsemestre_id),
) )
) )
document.build(story) document.multiBuild(story)
data = report.getvalue() data = report.getvalue()
return data return data

View File

@ -121,8 +121,7 @@ def _list_dept_logos(dept_id=None, prefix=scu.LOGO_FILE_PREFIX):
:return: le résultat de la recherche ou None si aucune image trouvée :return: le résultat de la recherche ou None si aucune image trouvée
""" """
allowed_ext = "|".join(scu.LOGOS_IMAGES_ALLOWED_TYPES) allowed_ext = "|".join(scu.LOGOS_IMAGES_ALLOWED_TYPES)
# parse filename 'logo_<logoname>.<ext> . be carefull: logoname may include '.' filename_parser = re.compile(f"{prefix}([^.]*).({allowed_ext})")
filename_parser = re.compile(f"{prefix}(([^.]*.)+)({allowed_ext})")
logos = {} logos = {}
path_dir = Path(scu.SCODOC_LOGOS_DIR) path_dir = Path(scu.SCODOC_LOGOS_DIR)
if dept_id: if dept_id:
@ -136,7 +135,7 @@ def _list_dept_logos(dept_id=None, prefix=scu.LOGO_FILE_PREFIX):
if os.access(path_dir.joinpath(entry).absolute(), os.R_OK): if os.access(path_dir.joinpath(entry).absolute(), os.R_OK):
result = filename_parser.match(entry.name) result = filename_parser.match(entry.name)
if result: if result:
logoname = result.group(1)[:-1] # retreive logoname from filename (less final dot) logoname = result.group(1)
logos[logoname] = Logo(logoname=logoname, dept_id=dept_id).select() logos[logoname] = Logo(logoname=logoname, dept_id=dept_id).select()
return logos if len(logos.keys()) > 0 else None return logos if len(logos.keys()) > 0 else None
@ -192,9 +191,6 @@ class Logo:
) )
self.mm = "Not initialized: call the select or create function before access" self.mm = "Not initialized: call the select or create function before access"
def __repr__(self) -> str:
return f"Logo(logoname='{self.logoname}', filename='{self.filename}')"
def _set_format(self, fmt): def _set_format(self, fmt):
self.suffix = fmt self.suffix = fmt
self.filepath = self.basepath + "." + fmt self.filepath = self.basepath + "." + fmt

View File

@ -303,12 +303,9 @@ def moduleimpl_inscriptions_stats(formsemestre_id):
) )
for mod in options: for mod in options:
if can_change: if can_change:
c_link = ( c_link = '<a class="discretelink" href="moduleimpl_inscriptions_edit?moduleimpl_id=%s">%s</a>' % (
'<a class="discretelink" href="moduleimpl_inscriptions_edit?moduleimpl_id=%s">%s</a>' mod["moduleimpl_id"],
% ( mod["descri"] or "<i>(inscrire des étudiants)</i>",
mod["moduleimpl_id"],
mod["descri"] or "<i>(inscrire des étudiants)</i>",
)
) )
else: else:
c_link = mod["descri"] c_link = mod["descri"]