fix: survive the screen library's sys.exit, copy all modules into the image, fit -10 degree readouts
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
ae8c17d8d5
commit
09f78d1a63
8 files changed
+78
-8
No files matched your search
@@ -36,7 +36,7 @@ def open_screen(factory: Callable[[], Any], *, running: Callable[[], bool],
|
||||
while running():
|
||||
try:
|
||||
return factory()
|
||||
except Exception as exc:
|
||||
except (Exception, SystemExit) as exc: # the screen library calls sys.exit(0) when the port is missing
|
||||
if not logged:
|
||||
log.warning("screen not available (%s); retrying every %.0f s", exc, retry_s)
|
||||
logged = True
|
||||
@@ -73,7 +73,7 @@ def run(view: View, lcd, *, now_fn: Callable[[], datetime], running: Callable[[]
|
||||
lcd.DisplayPILImage(patch.image, patch.x, patch.y)
|
||||
last_second = now.second
|
||||
failures = 0
|
||||
except Exception:
|
||||
except (Exception, SystemExit): # SystemExit: the library exits when it cannot reopen the port
|
||||
log.exception("draw failed")
|
||||
failures += 1
|
||||
last_key = None # redraw everything on the next tick
|
||||
|
||||
Reference in new issue
Block a user