Feat: remise sur pieds pour les tests
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
from .default_planner import default_planner
|
||||
from .only_corr_planner import only_corr_planner
|
||||
|
@@ -11,16 +11,16 @@ def list_files(dir=".", accept=lambda _: True, reject=lambda _: False):
|
||||
return files
|
||||
|
||||
|
||||
def only_corr_planner(options: dict) -> list[Task]:
|
||||
def planner(options: dict) -> list[Task]:
|
||||
sources = list_files(
|
||||
accept=lambda x: x.endswith(".tex"),
|
||||
reject=lambda x: x.startswith("tpl_"),
|
||||
)
|
||||
options["sources"] = sources
|
||||
return only_corr_tasks_builder(options)
|
||||
return tasks_builder(options)
|
||||
|
||||
|
||||
def only_corr_tasks_builder(
|
||||
def tasks_builder(
|
||||
options: dict,
|
||||
) -> list[Task]:
|
||||
opt = {
|
@@ -20,7 +20,7 @@ def build_subject_list_from_qty(qty: int) -> list[dict]:
|
||||
return subjects
|
||||
|
||||
|
||||
def default_planner(options: dict) -> list[Task]:
|
||||
def planner(options: dict) -> list[Task]:
|
||||
try:
|
||||
students_csv = options["students_csv"]
|
||||
|
||||
@@ -37,10 +37,10 @@ def default_planner(options: dict) -> list[Task]:
|
||||
infos = csv.DictReader(csv_file)
|
||||
options["subjects"] = build_subject_list_from_infos(infos)
|
||||
|
||||
return default_tasks_builder(options)
|
||||
return tasks_builder(options)
|
||||
|
||||
|
||||
def default_tasks_builder(
|
||||
def tasks_builder(
|
||||
options: dict,
|
||||
) -> list[Task]:
|
||||
|
||||
@@ -67,8 +67,9 @@ def default_tasks_builder(
|
||||
|
||||
for subject in subjects:
|
||||
source = naming.template2source(template, subject)
|
||||
args = {**subject, **options}
|
||||
|
||||
tasks.append(generate(template, {**subject, **opt}, source))
|
||||
tasks.append(generate(template, args, source))
|
||||
|
||||
if not no_pdf:
|
||||
pdf = naming.source2pdf(source)
|
Reference in New Issue
Block a user