diff --git a/bopytex/bopytex.py b/bopytex/bopytex.py index c863828..a9aaa46 100755 --- a/bopytex/bopytex.py +++ b/bopytex/bopytex.py @@ -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,