ZeroPhone / ZPUI

Official ZeroPhone UI framework, based on pyLCI
http://zpui.rtfd.org/
Apache License 2.0
79 stars 19 forks source link

Possible to add a "with loading_bar.paused():" construct? #126

Closed CRImier closed 5 years ago

CRImier commented 5 years ago

Currently, if there's a LoadingIndicator of some sort in background and we need to print stuff on the screen, we need to do:

li.pause()
Printer("stuff", i, o)
li.resume()

Would be great to have it work like this:

with li.paused():
    Printer("stuff", i, o)

Would help cleaning up and failproofing code in apps that have loading-bar-pause-heavy functions, like the "WiFi repair" and "Avrdude" apps.

CRImier commented 5 years ago

Done - thanks to @psbleep !