diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-06 13:28:48 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-06 17:38:30 +0000 |
| commit | c9b71a9817703e6a70b85fbc07d50c783901ba25 (patch) | |
| tree | ba326ace21f434c60f2f20d84c92111789f8395f /bitbake/lib | |
| parent | d10f58d2984f9a407a2473cf07187f10532334b3 (diff) | |
| download | poky-c9b71a9817703e6a70b85fbc07d50c783901ba25.tar.gz | |
bitbake: knotty: Correctly handle multiple line items
Currently the footer code doesn't quite handle multiline items correct.
Fix this to do so.
(Bitbake rev: 8eeccf73185d986c6abd6426b1d1e72da3a982df)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 528b8a0760..1bcdc0023a 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
| @@ -292,9 +292,9 @@ class TerminalFilter(object): | |||
| 292 | progress = 0 | 292 | progress = 0 |
| 293 | content = self.main_progress.update(progress) | 293 | content = self.main_progress.update(progress) |
| 294 | print('') | 294 | print('') |
| 295 | lines = 1 + int(len(content) / (self.columns + 1)) | 295 | lines = self.getlines(content) |
| 296 | if self.quiet == 0: | 296 | if self.quiet == 0: |
| 297 | for tasknum, task in enumerate(tasks[:(self.rows - 2)]): | 297 | for tasknum, task in enumerate(tasks[:(self.rows - 1 - lines)]): |
| 298 | if isinstance(task, tuple): | 298 | if isinstance(task, tuple): |
| 299 | pbar, progress, rate, start_time = task | 299 | pbar, progress, rate, start_time = task |
| 300 | if not pbar.start_time: | 300 | if not pbar.start_time: |
| @@ -311,11 +311,17 @@ class TerminalFilter(object): | |||
| 311 | else: | 311 | else: |
| 312 | content = "%s: %s" % (tasknum, task) | 312 | content = "%s: %s" % (tasknum, task) |
| 313 | print(content) | 313 | print(content) |
| 314 | lines = lines + 1 + int(len(content) / (self.columns + 1)) | 314 | lines = lines + self.getlines(content) |
| 315 | self.footer_present = lines | 315 | self.footer_present = lines |
| 316 | self.lastpids = runningpids[:] | 316 | self.lastpids = runningpids[:] |
| 317 | self.lastcount = self.helper.tasknumber_current | 317 | self.lastcount = self.helper.tasknumber_current |
| 318 | 318 | ||
| 319 | def getlines(self, content): | ||
| 320 | lines = 0 | ||
| 321 | for line in content.split("\n"): | ||
| 322 | lines = lines + 1 + int(len(line) / (self.columns + 1)) | ||
| 323 | return lines | ||
| 324 | |||
| 319 | def finish(self): | 325 | def finish(self): |
| 320 | if self.stdinbackup: | 326 | if self.stdinbackup: |
| 321 | fd = sys.stdin.fileno() | 327 | fd = sys.stdin.fileno() |
