diff options
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index a34991bb68..326f164353 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
| @@ -78,6 +78,7 @@ def init(server, eventHandler): | |||
| 78 | return 1 | 78 | return 1 |
| 79 | 79 | ||
| 80 | pbar = None | 80 | pbar = None |
| 81 | interactive = os.isatty(sys.stdout.fileno()) | ||
| 81 | shutdown = 0 | 82 | shutdown = 0 |
| 82 | return_value = 0 | 83 | return_value = 0 |
| 83 | while True: | 84 | while True: |
| @@ -132,23 +133,26 @@ def init(server, eventHandler): | |||
| 132 | if isinstance(event, bb.build.TaskBase): | 133 | if isinstance(event, bb.build.TaskBase): |
| 133 | logger.info(event._message) | 134 | logger.info(event._message) |
| 134 | continue | 135 | continue |
| 136 | if isinstance(event, bb.event.ParseStarted): | ||
| 137 | if interactive: | ||
| 138 | pbar = progressbar.ProgressBar(widgets=widgets, | ||
| 139 | maxval=event.total).start() | ||
| 140 | else: | ||
| 141 | sys.stdout.write("Parsing recipes...") | ||
| 142 | sys.stdout.flush() | ||
| 143 | continue | ||
| 135 | if isinstance(event, bb.event.ParseProgress): | 144 | if isinstance(event, bb.event.ParseProgress): |
| 136 | current, total = event.sofar, event.total | 145 | if interactive: |
| 137 | if os.isatty(sys.stdout.fileno()): | 146 | pbar.update(event.current) |
| 138 | if not pbar: | 147 | continue |
| 139 | pbar = progressbar.ProgressBar(widgets=widgets, | 148 | if isinstance(event, bb.event.ParseCompleted): |
| 140 | maxval=total).start() | 149 | if interactive: |
| 141 | pbar.update(current) | 150 | pbar.update(event.total) |
| 142 | else: | 151 | else: |
| 143 | if current == 1: | 152 | sys.stdout.write("done.\n") |
| 144 | sys.stdout.write("Parsing .bb files, please wait...") | 153 | sys.stdout.flush() |
| 145 | sys.stdout.flush() | 154 | print(("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors." |
| 146 | if current == total: | 155 | % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors))) |
| 147 | sys.stdout.write("done.") | ||
| 148 | sys.stdout.flush() | ||
| 149 | if current == total: | ||
| 150 | print(("\nParsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors." | ||
| 151 | % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors))) | ||
| 152 | continue | 156 | continue |
| 153 | 157 | ||
| 154 | if isinstance(event, bb.command.CookerCommandCompleted): | 158 | if isinstance(event, bb.command.CookerCommandCompleted): |
