Skip to contentSkip to conversation

tinfoil: Only allow one process progress bar at once (continued)

PATCH New Peter Kjellerstedt 1 participant 1 message Mar 24

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tinfoil: Only allow one process progress bar at once (continued)

In commit fcf6effe8c6de015e0ec65f908b606af6d096c23, the handling of process progress bars was changed so that only one can be active at once. However, for tinfoil it was only half done as apparently virtually the same code exists in two places and only the first was updated. This corrects the second occurence.

---
 lib/bb/tinfoil.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
lib/bb/tinfoil.py +5 -5
index 9c1768942..634d7796f 100644
@@ -927,23 +927,23 @@ class Tinfoil:
                             if isinstance(event, bb.event.ProcessStarted):
                                 if self.quiet > 1:
                                     continue
+                                if parseprogress:
+                                    parseprogress.finish()
                                 parseprogress = bb.ui.knotty.new_progress(event.processname, event.total)
                                 parseprogress.start(False)
                                 continue
                             if isinstance(event, bb.event.ProcessProgress):
                                 if self.quiet > 1:
                                     continue
-                                if parseprogress:
+                                if parseprogress and parseprogress.id == event.processname:
                                     parseprogress.update(event.progress)
-                                else:
-                                    bb.warn("Got ProcessProgress event for something that never started?")
                                 continue
                             if isinstance(event, bb.event.ProcessFinished):
                                 if self.quiet > 1:
                                     continue
-                                if parseprogress:
+                                if parseprogress and parseprogress.id == event.processname:
                                     parseprogress.finish()
-                                parseprogress = None
+                                    parseprogress = None
                                 continue
                             if isinstance(event, bb.command.CommandCompleted):
                                 result = True