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 = {