1
0
forked from ScoDoc/ScoDoc

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(
"bul_show_minmax_mod", formsemestre_id
):
rang_minmax = (
'%s <span class="bul_minmax" title="[min, max] UE">[%s, %s]</span>'
% (
mod["mod_rang_txt"],
scu.fmt_note(mod["stats"]["min"]),
scu.fmt_note(mod["stats"]["max"]),
)
rang_minmax = '%s <span class="bul_minmax" title="[min, max] UE">[%s, %s]</span>' % (
mod["mod_rang_txt"],
scu.fmt_note(mod["stats"]["min"]),
scu.fmt_note(mod["stats"]["max"]),
)
else:
rang_minmax = mod["mod_rang_txt"] # vide si pas option rang

View File

@ -75,7 +75,7 @@ import sco_version
def assemble_bulletins_pdf(
formsemestre_id: int,
story,
story: list,
bul_title: str,
infos,
pagesbookmarks=None,
@ -107,7 +107,7 @@ def assemble_bulletins_pdf(
preferences=sco_preferences.SemPreferences(formsemestre_id),
)
)
document.build(story)
document.multiBuild(story)
data = report.getvalue()
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
"""
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 = {}
path_dir = Path(scu.SCODOC_LOGOS_DIR)
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):
result = filename_parser.match(entry.name)
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()
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"
def __repr__(self) -> str:
return f"Logo(logoname='{self.logoname}', filename='{self.filename}')"
def _set_format(self, fmt):
self.suffix = fmt
self.filepath = self.basepath + "." + fmt

View File

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