refactor(gui): _async_refresh_preview 闭包内联到 periodic_refreshers (398 → 396)

This commit is contained in:
Your Name committed 2026-05-30 19:09:37 +08:00
1 parent da5e000006
commit 6cebed599d
2 files changed
+5 -6

No files matched your search

+3 -2
View File
@@ -18,7 +18,8 @@ def setup_periodic_refreshers(
root: tk.Misc,
*,
image_var: tk.StringVar,
async_refresh_preview: Callable[[], None],
async_refresh_preview_impl: Callable[[Any], None],
preview_view: Any,
refresh_stats: Callable[[], None],
refresh_reservations: Callable[[], None],
refresh_high_value_rooms: Callable[[], None],
@@ -30,7 +31,7 @@ def setup_periodic_refreshers(
def delayed_refresh_preview() -> None:
if image_var.get():
async_refresh_preview()
async_refresh_preview_impl(preview_view)
root.after(3000, delayed_refresh_preview) # type: ignore[arg-type]
root.after(500, refresh_stats) # type: ignore[arg-type]
+2 -4
View File
@@ -368,13 +368,11 @@ def main():
pump_logs()
def _async_refresh_preview() -> None:
_async_refresh_preview_impl(_preview_view)
setup_periodic_refreshers(
root,
image_var=image_var,
async_refresh_preview=_async_refresh_preview,
async_refresh_preview_impl=_async_refresh_preview_impl,
preview_view=_preview_view,
refresh_stats=refresh_stats,
refresh_reservations=refresh_reservations,
refresh_high_value_rooms=refresh_high_value_rooms,