From 4f093bb48ecfaf160cad6290556baf8ef4aa70d9 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 15 Mar 2025 11:55:52 +0000 Subject: [PATCH] tui: Add a status callback This will be called by Pakfire to tell us what it is doing... Signed-off-by: Michael Tremer --- src/python/tui.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/python/tui.py b/src/python/tui.py index e0c2b45..751192d 100644 --- a/src/python/tui.py +++ b/src/python/tui.py @@ -432,12 +432,19 @@ class ProgressWindow(Window): def update(self, value): """ - Updates the current status + Updates the current progress """ if self.scale: self.scale.set(value) self.tui.refresh() + def status(self, text): + """ + Updates the current status + """ + self.textbox.setText(text or "") + self.tui.refresh() + class ProgressWindowCallbacks(object): def __init__(self, window): @@ -453,8 +460,7 @@ class ProgressWindowCallbacks(object): """ Updates the text in the textbox """ - self.window.textbox.setText(text) - self.window.tui.refresh() + self.window.status(text) def status(self, progress, message): if progress: -- 2.47.2