(ok: bool, path: str | None = None, cost_cents: int = 0, error: str | None = None)
| 59 | |
| 60 | |
| 61 | def result_json(ok: bool, path: str | None = None, cost_cents: int = 0, error: str | None = None): |
| 62 | d = {"ok": ok, "cost_cents": cost_cents} |
| 63 | if path: |
| 64 | d["path"] = path |
| 65 | if error: |
| 66 | d["error"] = error |
| 67 | print(json.dumps(d)) |
| 68 | |
| 69 | |
| 70 | # --- Image backends --- |
no outgoing calls
no test coverage detected