Skip to content
Snippets Groups Projects
Verified Commit 388e7bd8 authored by dos's avatar dos
Browse files

py,st3m: about: Update space screen when entering the view

Available space may have changed since the view has been instantiated.
parent a442ef6a
Branches
Tags
1 merge request!582py,st3m: about: Update space screen when entering the view
Pipeline #9283 passed
......@@ -33,6 +33,9 @@ class Screen(Responder):
def think(self, ins: InputState, delta_ms: int) -> None:
pass
def update(self) -> None:
pass
class HeroScreen(Screen):
"""
......@@ -74,6 +77,9 @@ class SpaceScreen(Screen):
"""
def __init__(self) -> None:
pass
def update(self) -> None:
flash_statvfs = os.statvfs("/flash")
flash_free = flash_statvfs[1] * flash_statvfs[3]
flash_total = flash_statvfs[1] * flash_statvfs[2]
......@@ -203,6 +209,11 @@ class About(BaseView):
self.screen_ix_anim = 0.0
super().__init__()
def on_enter(self, vm: Optional["ViewManager"]) -> None:
super().__init__(vm)
for screen in self.screens:
screen.update()
def think(self, ins: InputState, delta_ms: int) -> None:
super().think(ins, delta_ms)
self.ts += delta_ms / 1000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment