mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 13:34:40 +00:00
fx
This commit is contained in:
+5
-2
@@ -65,7 +65,7 @@ async def run_latex_two_passes(
|
||||
Zwraca: (ok, log_text, pdf_path).
|
||||
"""
|
||||
logger_obj = logging.getLogger(logger) if logger else logging.getLogger()
|
||||
logger_obj.info("Compiling %s with %s engine", tex_filename, tex_engine)
|
||||
logger_obj.info("Compiling %s with %s engine two passes", tex_filename, tex_engine)
|
||||
logs: List[str] = []
|
||||
pdf_path = workdir / (Path(tex_filename).stem + ".pdf")
|
||||
|
||||
@@ -96,7 +96,7 @@ async def compile_single_tex_bytes(
|
||||
Każdy plik zapisujemy w katalogu roboczym widocznym dla kompilatora.
|
||||
"""
|
||||
log = logging.getLogger(logger) if logger else logging.getLogger()
|
||||
log.info("Compiling %s with %s engine", filename, tex_engine)
|
||||
log.info("Compiling %s with %s engine single tex", filename, tex_engine)
|
||||
if not is_safe_tex_name(filename):
|
||||
return {"ok": False, "pdf_bytes": None, "log_text": "Invalid .tex filename", "pdf_name": None}
|
||||
|
||||
@@ -113,6 +113,9 @@ async def compile_single_tex_bytes(
|
||||
(wd / Path(fname).name).write_bytes(data)
|
||||
|
||||
ok, log_text, pdf_path = await run_latex_two_passes(Path(filename).name, wd, tex_engine, timeout_sec, logger)
|
||||
log.info("LaTeX compile finished: %s", "OK" if ok else "FAIL")
|
||||
log.info("Log text:\n%s", log_text[-2000:]) # Log last 2000 chars
|
||||
log.info("PDF path: %s", pdf_path)
|
||||
if ok and pdf_path.exists():
|
||||
return {
|
||||
"ok": True,
|
||||
|
||||
Reference in New Issue
Block a user