]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
tui: Add a status callback
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 15 Mar 2025 11:55:52 +0000 (11:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 15 Mar 2025 11:55:52 +0000 (11:55 +0000)
This will be called by Pakfire to tell us what it is doing...

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/tui.py

index e0c2b451fb5e405ecf928eacd29107aa6fcc8165..751192ddcce401305a2a078b6327e05f1d36fb88 100644 (file)
@@ -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: