diff options
| author | Peter Kjellerstedt <pkj@axis.com> | 2025-10-25 05:25:49 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:15:34 +0000 |
| commit | 55efa6caa605a34dba3077a5bcd75131f1057fec (patch) | |
| tree | 4e97c6289feaaa9c61f40542ffdf3277bc53dc8c /bitbake/lib | |
| parent | d412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff) | |
| download | poky-55efa6caa605a34dba3077a5bcd75131f1057fec.tar.gz | |
bitbake: knotty: Some improvements to TerminalFilter.updateFooter()
* Correct/improve a couple of comments.
* Iterate over the values (tasks) of activetasks rather than the keys
(TIDs) as the TIDs were only used to lookup the tasks.
(Bitbake rev: ab1923a3ff8a9f439683d77ee53d03a8b039bdd1)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 00258c80ff..6f03bf2faa 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
| @@ -260,16 +260,16 @@ class TerminalFilter(object): | |||
| 260 | self.helper.needUpdate = True | 260 | self.helper.needUpdate = True |
| 261 | need_update = self.helper.needUpdate | 261 | need_update = self.helper.needUpdate |
| 262 | else: | 262 | else: |
| 263 | # Do not let to update faster then _DEFAULT_PRINT_INTERVAL | 263 | # Do not update faster than _DEFAULT_PRINT_INTERVAL |
| 264 | # to avoid heavy print() flooding. | 264 | # to avoid heavy print() flooding. |
| 265 | need_update = self.helper.needUpdate and (deltatime > self._DEFAULT_PRINT_INTERVAL) | 265 | need_update = self.helper.needUpdate and (deltatime > self._DEFAULT_PRINT_INTERVAL) |
| 266 | 266 | ||
| 267 | if self.footer_present and (not need_update): | 267 | if self.footer_present and not need_update: |
| 268 | # Footer update is not need. | 268 | # Footer update is not needed. |
| 269 | return | 269 | return |
| 270 | else: | 270 | |
| 271 | # Footer update is need and store its "lasttime" value. | 271 | # Remember the time when the footer was last updated. |
| 272 | self.lasttime = currenttime | 272 | self.lasttime = currenttime |
| 273 | 273 | ||
| 274 | self.helper.needUpdate = False | 274 | self.helper.needUpdate = False |
| 275 | if (not self.helper.tasknumber_total or self.helper.tasknumber_current == self.helper.tasknumber_total) and not len(activetasks): | 275 | if (not self.helper.tasknumber_total or self.helper.tasknumber_current == self.helper.tasknumber_total) and not len(activetasks): |
| @@ -281,16 +281,16 @@ class TerminalFilter(object): | |||
| 281 | self._footer_buf.seek(0) | 281 | self._footer_buf.seek(0) |
| 282 | 282 | ||
| 283 | tasks = [] | 283 | tasks = [] |
| 284 | for t in activetasks.keys(): | 284 | for task in activetasks.values(): |
| 285 | start_time = activetasks[t].get("starttime", None) | 285 | start_time = task.get("starttime", None) |
| 286 | if start_time: | 286 | if start_time: |
| 287 | msg = "%s - %s (pid %s)" % (activetasks[t]["title"], self.elapsed(currenttime - start_time), activetasks[t]["pid"]) | 287 | msg = "%s - %s (pid %s)" % (task["title"], self.elapsed(currenttime - start_time), task["pid"]) |
| 288 | else: | 288 | else: |
| 289 | msg = "%s (pid %s)" % (activetasks[t]["title"], activetasks[t]["pid"]) | 289 | msg = "%s (pid %s)" % (task["title"], task["pid"]) |
| 290 | progress = activetasks[t].get("progress", None) | 290 | progress = task.get("progress", None) |
| 291 | if progress is not None: | 291 | if progress is not None: |
| 292 | pbar = activetasks[t].get("progressbar", None) | 292 | pbar = task.get("progressbar", None) |
| 293 | rate = activetasks[t].get("rate", None) | 293 | rate = task.get("rate", None) |
| 294 | if not pbar or pbar.bouncing != (progress < 0): | 294 | if not pbar or pbar.bouncing != (progress < 0): |
| 295 | if progress < 0: | 295 | if progress < 0: |
| 296 | pbar = BBProgress("0: %s" % msg, 100, widgets=[' ', progressbar.BouncingSlider(), ''], extrapos=3, resize_handler=self.sigwinch_handle) | 296 | pbar = BBProgress("0: %s" % msg, 100, widgets=[' ', progressbar.BouncingSlider(), ''], extrapos=3, resize_handler=self.sigwinch_handle) |
| @@ -299,7 +299,7 @@ class TerminalFilter(object): | |||
| 299 | pbar = BBProgress("0: %s" % msg, 100, widgets=[' ', progressbar.Percentage(), ' ', progressbar.Bar(), ''], extrapos=5, resize_handler=self.sigwinch_handle) | 299 | pbar = BBProgress("0: %s" % msg, 100, widgets=[' ', progressbar.Percentage(), ' ', progressbar.Bar(), ''], extrapos=5, resize_handler=self.sigwinch_handle) |
| 300 | pbar.bouncing = False | 300 | pbar.bouncing = False |
| 301 | pbar.fd = self._footer_buf | 301 | pbar.fd = self._footer_buf |
| 302 | activetasks[t]["progressbar"] = pbar | 302 | task["progressbar"] = pbar |
| 303 | tasks.append((pbar, msg, progress, rate, start_time)) | 303 | tasks.append((pbar, msg, progress, rate, start_time)) |
| 304 | else: | 304 | else: |
| 305 | tasks.append(msg) | 305 | tasks.append(msg) |
