From 3d26a8ec018c79166e03b46244a3c7a14d14a849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Tue, 31 Mar 2026 11:14:52 +0200 Subject: [PATCH] automatically find enonce --- enonce_info.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/enonce_info.py b/enonce_info.py index 2d19fa3..c65ccd8 100644 --- a/enonce_info.py +++ b/enonce_info.py @@ -30,10 +30,19 @@ def process_directory(directory): # Find the first .tex file in the directory tex_files = glob.glob(os.path.join(directory, "*.tex")) if not tex_files: - print(f"No .tex file found in {directory}") - return - - tex_file = tex_files[0] + print(f"No .tex file found in {directory}. Looking in /Staging/Interro/") + if directory[-1] == "/": + int_name = directory[:-1] + else: + int_name = directory + tex_path = os.path.join("~/Prépa/Staging/Interro/", int_name, ".tex") + if os.path.exists(tex_path): + tex_file = tex_path + else: + print("Not found.") + return + else: + tex_file = tex_files[0] # Prepare output directories paths = {