|
|
|
|
@ -220,12 +220,12 @@ def documentex(dossier: str, type_document: str):
|
|
|
|
|
template = constantes.latex_jinja_env.get_template(os.path.abspath(fichier))
|
|
|
|
|
outfile.write(template.render(date=date,contenu=contenu,tex_file=tex_file,fancyhead=fancyhead,type_ecrit=type_document,short_title=short_title,lycee=lycee,classe=classe,title=title,auteur=auteur,semaine=semaine,liste_noms=liste_noms,td=td,ds_numero=ds_numero,annee=annee,institution=institution,nom_institution=nom_institution,lycee_adresse=lycee_adresse,lycee_complement_adresse=lycee_complement_adresse,auteur_lettre=auteur_lettre,auteur_titre=auteur_titre,auteur_adresse_mail=auteur_adresse_mail))
|
|
|
|
|
# Création du dossier de correction avec les fichiers pré-remplis
|
|
|
|
|
fichiers = glob.glob(os.path.join(nom_fichier,'*'))
|
|
|
|
|
fichiers = [fichier for fichier in fichiers if 'Utils' not in fichier ]
|
|
|
|
|
if type_document in constantes.type_document_correction:
|
|
|
|
|
os.makedirs(os.path.join(nom_fichier,'Correction'))
|
|
|
|
|
shutil.copytree(os.path.join(nom_fichier,'Utils'),os.path.join(os.path.join(nom_fichier,'Correction'),'Utils'))
|
|
|
|
|
for fichier in fichiers:
|
|
|
|
|
shutil.copy(fichier,os.path.join(nom_fichier,'Correction'))
|
|
|
|
|
# fichiers = glob.glob(os.path.join(nom_fichier,'*'))
|
|
|
|
|
# fichiers = [fichier for fichier in fichiers if 'Utils' not in fichier ]
|
|
|
|
|
# if type_document in constantes.type_document_correction:
|
|
|
|
|
# os.makedirs(os.path.join(nom_fichier,'Correction'))
|
|
|
|
|
# shutil.copytree(os.path.join(nom_fichier,'Utils'),os.path.join(os.path.join(nom_fichier,'Correction'),'Utils'))
|
|
|
|
|
# for fichier in fichiers:
|
|
|
|
|
# shutil.copy(fichier,os.path.join(nom_fichier,'Correction'))
|
|
|
|
|
|
|
|
|
|
click.secho(f"Le dossier LaTeX {nom_fichier} a été crée !", fg="red")
|
|
|
|
|
|