support icon indicating copy to clipboard operation
support copied to clipboard

[Feature] Make stop button readable

Open laurensvalk opened this issue 1 year ago • 1 comments

You can set the stop button combination with hub.system.set_stop_button but not currently read it.

It would be nice if you could read it. Then you can restore it after running code that raises an exception.

We do that in a few places in the firmware right now, but can't currently do that in Python.

laurensvalk avatar Jun 25 '24 07:06 laurensvalk

Maybe too fancy, but it would be cool if hub.system.set_stop_button() returned a context manager object, then we could write:

with hub.system.set_stop_button(...):
    # main code here
    ...

Everything would be done in a single line rather than having to have a separate getter function and a try/finally block.

dlech avatar Jun 25 '24 15:06 dlech