From: Michael Tremer Date: Mon, 9 May 2022 16:13:10 +0000 (+0000) Subject: pakfire: Use new status callback feature X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a064b1b7da87d408bbb51b6701921dad17c6fd1e;p=people%2Fms%2Fbricklayer.git pakfire: Use new status callback feature Signed-off-by: Michael Tremer --- diff --git a/src/python/step.py b/src/python/step.py index e1c8a0a..3d2417b 100644 --- a/src/python/step.py +++ b/src/python/step.py @@ -75,11 +75,11 @@ class Step(object): # Set up Pakfire with self.tui.progress(title, _("Installing packages..."), max_value=100) as t: # Create a new Pakfire instance - p = self.bricklayer.setup_pakfire(**t.callbacks) + p = self.bricklayer.setup_pakfire() try: # Install packages - p.install(packages) + p.install(packages, status_callback=t.status) # Abort on any dependencies problems except pakfire.errors.DependencyError as e: diff --git a/src/python/tui.py b/src/python/tui.py index 1078d32..82e2d50 100644 --- a/src/python/tui.py +++ b/src/python/tui.py @@ -411,22 +411,19 @@ class ProgressWindowCallbacks(object): self.window.scale.set(value) self.window.tui.refresh() - def status(self, text): + def message(self, text): """ Updates the text in the textbox """ self.window.textbox.setText(text) self.window.tui.refresh() - @property - def callbacks(self): - """ - Returns callbacks that can be passed to Pakfire - """ - return { - "status_callback" : self.status, - "progress_callback" : self.progress, - } + def status(self, progress, message): + if progress: + self.progress(progress) + + if message: + self.message(message) class PasswordWindow(ButtonsWindow):