diff options
author | Chandan Singh <chandan@chandansingh.net> | 2019-11-11 23:18:56 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-11-12 11:28:21 +0000 |
commit | 104cfe224c4be2343e67ad1c46d84553034eab89 (patch) | |
tree | 34e5d6212ab1ab136288992bd4b61922e52071b9 /src/buildstream/_frontend/app.py | |
parent | 149c2c26470c42bbc4d3ee38fbcb3a94078b26df (diff) | |
download | buildstream-104cfe224c4be2343e67ad1c46d84553034eab89.tar.gz |
_frontend: Simplify color handling
Currently we store color configuration in our App object, and have to
remember to pass it around to `click.echo()` when printing things on the
screen. This is error-prone as we can forget to do so. This leads to
bugs like #1200, where `bst init` was not respecting `--no-colors` flag.
Instead of doing that, this patch controls colors in output by
configuring the `click.Context` object.
Fixes #1200.
Diffstat (limited to 'src/buildstream/_frontend/app.py')
-rw-r--r-- | src/buildstream/_frontend/app.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/buildstream/_frontend/app.py b/src/buildstream/_frontend/app.py index 596ef168a..99e164358 100644 --- a/src/buildstream/_frontend/app.py +++ b/src/buildstream/_frontend/app.py @@ -251,7 +251,7 @@ class App(): self._status = Status(self.context, self._state, self._content_profile, self._format_profile, self._success_profile, self._error_profile, - self.stream, colors=self.colors) + self.stream) # Mark the beginning of the session if session_name: @@ -680,8 +680,7 @@ class App(): if self._session_name: self.logger.print_heading(self.project, self.stream, - log_file=self._main_options['log_file'], - styling=self.colors) + log_file=self._main_options['log_file']) # # Print a summary of the queues @@ -689,8 +688,7 @@ class App(): def _print_summary(self): click.echo("", err=True) self.logger.print_summary(self.stream, - self._main_options['log_file'], - styling=self.colors) + self._main_options['log_file']) # _error_exit() # @@ -749,7 +747,7 @@ class App(): self._status.clear() text = self.logger.render(message) - click.echo(text, color=self.colors, nl=False, err=True) + click.echo(text, nl=False, err=True) # Maybe render the status area self._maybe_render_status() |