1
0
forked from ScoDoc/ScoDoc

adaptation de la sauvegarde des fichiers logos poursuites d'études

This commit is contained in:
Jean-Marie Place 2021-11-07 09:02:53 +01:00
parent 5e461f7dd6
commit d7e34b8ce2

View File

@ -44,6 +44,7 @@ import unicodedata
import app.scodoc.sco_utils as scu
from app import log
from app.scodoc.sco_logos import find_logo
PE_DEBUG = 0
@ -201,11 +202,11 @@ def add_pe_stuff_to_zip(zipfile, ziproot):
add_local_file_to_zip(zipfile, ziproot, pathname, "avis/" + filename)
# Logos: (add to logos/ directory in zip)
logos_names = ["logo_header.jpg", "logo_footer.jpg"]
for f in logos_names:
logo = os.path.join(scu.SCODOC_LOGOS_DIR, f)
if os.path.isfile(logo):
add_local_file_to_zip(zipfile, ziproot, logo, "avis/logos/" + f)
logos_names = ["header", "footer"]
for name in logos_names:
logo = find_logo(logoname=name, dept_id=g.scodoc_dept_id)
if logo is not None:
add_local_file_to_zip(zipfile, ziproot, logo, "avis/logos/" + logo.filename)
# ----------------------------------------------------------------------------------------