From db0e980c28f939010b212993acf84ee7720ba5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BBebrak?= <mzebrak@syncad.com> Date: Tue, 18 Jul 2023 10:22:56 +0200 Subject: [PATCH] Rename DynamicPropertiesClock callbacks --- clive/__private/ui/widgets/header.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clive/__private/ui/widgets/header.py b/clive/__private/ui/widgets/header.py index 944da8c75f..129e792bef 100644 --- a/clive/__private/ui/widgets/header.py +++ b/clive/__private/ui/widgets/header.py @@ -67,17 +67,17 @@ class AlarmsSummary(Container, CliveWidget): class DynamicPropertiesClock(Horizontal, CliveWidget): def compose(self) -> ComposeResult: - yield DynamicLabel(self.app.world, "app_state", self.__update_block_num, id_="block_num") - yield DynamicLabel(self.app.world, "app_state", self.__update_chain_time, id_="chain_time") - yield DynamicLabel(self.app.world, "app_state", self.__update_last_update, id_="last_update") + yield DynamicLabel(self.app.world, "app_state", self.__get_block_num, id_="block_num") + yield DynamicLabel(self.app.world, "app_state", self.__get_chain_time, id_="chain_time") + yield DynamicLabel(self.app.world, "app_state", self.__get_last_update, id_="last_update") - def __update_block_num(self, app_state: AppState) -> str: + def __get_block_num(self, app_state: AppState) -> str: return f"block: {app_state.get_dynamic_global_properties().head_block_number}" - def __update_chain_time(self, app_state: AppState) -> str: + def __get_chain_time(self, app_state: AppState) -> str: return f"{app_state.get_dynamic_global_properties().time.time()} UTC" - def __update_last_update(self, app_state: AppState) -> str: + def __get_last_update(self, app_state: AppState) -> str: gdpo = app_state.get_dynamic_global_properties() last_update = humanize.naturaltime(datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc) - gdpo.time) return f"last update: {last_update}" -- GitLab