Skip to content

P18 phase 1: ▶ Ausführen becomes ■ Stoppen while Python is busy - #19

Merged
cedricvogel-leo merged 2 commits into
mainfrom
feature/stop-button
Oct 25, 2026
Merged

cedricvogel-leo merged 2 commits into
mainfrom
feature/stop-button

Conversation

@cedricvogel-leo

Copy link
Copy Markdown
Collaborator

Macro part of P18 phase 1. It needs glpython-edu/glpython-editor#29 (embed protocol version 4) to be merged and deployed first. Before that, nothing changes: an older embed doesn't announce stop.

Change

  • While Python is busy for more than a moment (a program, a REPL input, Tests), ▶ Ausführen becomes ■ Stoppen in the same place. It keeps the button's width, so the row doesn't move.
  • Clicking it sends glpython:stop: Python restarts, the code stays, and the console notes it («Gestoppt. Python wurde neu gestartet.»).
  • Protocol version 4 with embeds that announce capabilities.stop. The macro sends each embed the newest version both understand (embedVersion()).
  • A fix on the way: the macro accepted the embed's answers only in versions 1 and the newest. The embed answers in the version the macro last used, so an embed that answered in version 2 or 3 was ignored. It now accepts 1–4.
  • README: one paragraph in «Buttons and profiles».

Tested in the hosted LiaScript player, the macro pointed at #29's embed built locally:

Macro / embed While while …: print(…) runs Stop
this / #29 «■ Stoppen», width 111 → 111px, Tests stays at x 447, output streams note in the console, back to «▶ Ausführen»
this / #29, while True: pass typed into the REPL «■ Stoppen» back to «▶ Ausführen»
this / deployed embed (v3) «▶ Ausführen» as before –
main / #29 «▶ Ausführen», output streams –

Coordination with P17. #17, #18 and this branch merge together without conflicts (checked locally, check-macro passes). I moved the busy handler next to, not into, #17's resize line.

🤖 Generated with Claude Code

cedricvogel-leo and others added 2 commits October 25, 2026 23:26
Speaks protocol version 4 with embeds that understand it: the embed says
when Python is busy (glpython:busy), and the run button then sends
glpython:stop, which restarts Python; the code stays. The button keeps its
width, so the row doesn't move. With an older embed nothing changes.

The macro now accepts the embed's answers in every version up to 4 (it
answers in the version the macro last used), not only 1 and the newest,
and sends each embed the newest version both understand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cedricvogel-leo
cedricvogel-leo merged commit a21e578 into main Oct 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant