{# Live output tail: while any script is running, htmx polls the refresh endpoint every 2s so print() output from long-running scripts (automatons especially) shows up without the operator clicking Refresh manually. When nothing's running, polling stops automatically because ``hx-trigger`` isn't attached. #} {% set any_running = statuses|selectattr('running')|list|length > 0 %} {% if run_error %}
| Name | Status | Output | Error | Actions |
|---|---|---|---|---|
| {{ s.name }} {% if s.path %} saved {% endif %} | {% if s.error %}error {% elif s.finished %}finished {% elif s.running %}running {% elif s.started_at %}starting {% else %}on disk{% endif %} |
{# print() output + anything the script wrote to sys.stderr
before crashing. Traceback still shows in the Error column. #}
{% if s.stdout or s.stderr %}
output ({{ (s.stdout|length) + (s.stderr|length) }} bytes){% if s.stdout %}{{ s.stdout }}
{% endif %}
{% if s.stderr %}
stderr:
{{ s.stderr }}
{% endif %}
|
{% if s.error %}traceback{{ s.error }}
|
{# Run / Re-run — only for scripts with a file on disk. Re-reads the file every click so the edit → save → run debug loop works. The runner replaces any same-named status entry so the row updates in-place with fresh output. #} {% if s.path %} {% endif %} {% if s.running %} {% endif %} {% if s.path %} {% endif %} {# Refresh pulls the latest captured output for long-running scripts (an automaton's ``print()`` in each ``handle()`` tick only appears here after a refresh). #} |
| No scripts running yet. | ||||