Feat: add list tex files with no tpl

This commit is contained in:
Bertrand Benjamin 2022-04-09 16:08:10 +02:00
parent 7f40b7c38f
commit 4e7805f40d
1 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,7 @@ Producing then compiling templates
import logging
import csv
import os
formatter = logging.Formatter("%(name)s :: %(levelname)s :: %(message)s")
steam_handler = logging.StreamHandler()
@ -32,6 +33,7 @@ def build_subject_list_from_qty(qty: int) -> list[dict]:
subjects.append({"number": str(i + 1).zfill(digit)})
return subjects
def build_subjects(students_csv, quantity_subjects):
if students_csv:
with open(students_csv, "r") as csv_file:
@ -41,6 +43,14 @@ def build_subjects(students_csv, quantity_subjects):
return build_subject_list_from_qty(quantity_subjects)
def list_tex_files_no_tpl(dir="."):
tex_files = []
for file in os.listdir(dir):
if file.endswith(".tex") and not file.startswith(tpl_):
tex_files.append(file)
return tex_files
def bopytex(
template: str,
working_dir: str,