Divers, en lien avec DMI04 (gemini_for_enonce.py, smaller images, link to enonce.pdf)

This commit is contained in:
2026-05-09 16:26:01 +02:00
parent 8d9165d0ac
commit 0836d5809d
9 changed files with 202 additions and 59 deletions
+12 -1
View File
@@ -309,7 +309,18 @@ class ImageViewer:
def on_open_interro(self, event):
if self.is_viewing and self.current_json_path:
pdf_path = "/home/sebastien/Prépa/Staging/Interro/" + str(base_dir) + ".pdf"
# Check local directory first
local_accent = self.base_dir / "énoncé.pdf"
local_plain = self.base_dir / "enonce.pdf"
if local_accent.exists():
pdf_path = str(local_accent)
elif local_plain.exists():
pdf_path = str(local_plain)
else:
# Fallback to the Interro staging directory
pdf_path = f"/home/sebastien/Prépa/Staging/Interro/{self.base_dir.name}.pdf"
print(f"Opening {pdf_path}")
subprocess.Popen(['xdg-open', pdf_path])