Update Python tools

This commit is contained in:
ajp_anton
2026-08-09 18:26:25 +00:00
parent 9c0ce2098f
commit 58b4f69d63
3 changed files with 19 additions and 7 deletions
+7 -3
View File
@@ -139,6 +139,7 @@ def create_app(settings: Settings | None = None) -> Flask:
"run.html",
run=run,
children=store.children(run.id),
output=read_run_output(run),
)
@app.post("/runs/<int:run_id>/cancel")
@@ -153,12 +154,15 @@ def create_app(settings: Settings | None = None) -> Flask:
run = store.get(run_id)
if run is None:
abort(404)
return {"output": read_run_output(run)}
def read_run_output(run) -> str:
if not run.log_path:
return {"output": ""}
return ""
try:
return {"output": Path(run.log_path).read_text(encoding="utf-8", errors="replace")}
return Path(run.log_path).read_text(encoding="utf-8", errors="replace")
except FileNotFoundError:
return {"output": ""}
return ""
@app.get("/runs/<int:run_id>/artifacts")
def run_artifacts(run_id: int):