From 380ec93c6a2ffb4e37aba8e88ffd116aced145f0 Mon Sep 17 00:00:00 2001 From: jeffser Date: Sun, 30 Jun 2024 18:09:06 -0600 Subject: [PATCH] Redesign for pulling model --- src/window.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index c3f8072..d109570 100644 --- a/src/window.py +++ b/src/window.py @@ -842,9 +842,12 @@ Generate a title following these rules: def pull_model_update(self, data, model_name): if model_name in list(self.pulling_models.keys()): - GLib.idle_add(self.pulling_models[model_name]['row'].set_subtitle, data['status']) - if 'completed' in data and 'total' in data: GLib.idle_add(self.pulling_models[model_name]['progress_bar'].set_fraction, (data['completed'] / data['total'])) - else: GLib.idle_add(self.pulling_models[model_name]['progress_bar'].pulse) + if 'completed' in data and 'total' in data: + GLib.idle_add(self.pulling_models[model_name]['row'].set_subtitle, '{}%\t{}'.format(round(data['completed'] / data['total'] * 100, 2), data['status'].capitalize())) + GLib.idle_add(self.pulling_models[model_name]['progress_bar'].set_fraction, (data['completed'] / data['total'])) + else: + GLib.idle_add(self.pulling_models[model_name]['row'].set_subtitle, '{}'.format(data['status'].capitalize())) + GLib.idle_add(self.pulling_models[model_name]['progress_bar'].pulse) else: if len(list(self.pulling_models.keys())) == 0: GLib.idle_add(self.pulling_model_list_box.set_visible, False)