[bitbake-devel] [PATCH v2] bitbake: Colorize knotty interactive console output

Seth Bollinger seth.boll at gmail.com
Wed Nov 14 13:18:06 UTC 2012


Thanks!  I've tested this and it works on my dark color scheme (it's better
actually :)).  I also tested on white and it looks fine.  If Richard is ok
with this solution, I'll make the changes and submit another patch.

Seth


On Tue, Nov 13, 2012 at 4:36 PM, Jason Wessel <jason.wessel at windriver.com>wrote:

> On 11/13/2012 09:22 AM, Richard Purdie wrote:
> > On Tue, 2012-11-13 at 08:45 -0600, Seth Bollinger wrote:
> >> I'm not sure how best to resolve this.  Would you like me to add some
> >> code to try and detect background color?  This seems like it might be
> >> more complex than it's worth...
> >>
> >> Or would it be better to have a selectable light background color
> >> set?  If you think light background is more common (I dislike staring
> >> at large blocks of white :)) it could default to the light color set.
> > I have not looked into this and am not an expert on terminals and colour
> > control of them. I don't know how we can solve this but the current
> > situation where it prints white on white on my terminal is clearly
> > unacceptable. This has to be a problem others have run into and solved
> > before though...
>
>
> If you are planning to colorize things, my recommendation would be to take
> the "middle ground" and use the transparency instead of using white which
> should work in general on any modern terminal.
>
> Change the patch a bit like this:
> +    color_enabled = False
> +    BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(30,38)
>
>     BASECOLOR, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE =
> range(29,38)
>
> +
> +    COLORS = {
> +        DEBUG3  : CYAN,
> +        DEBUG2  : CYAN,
> +        DEBUG   : CYAN,
> +        VERBOSE : BASECOLOR,
> +        NOTE    : BASECOLOR,
> +        PLAIN   : BASECOLOR,
> +        WARNING : YELLOW,
> +        ERROR   : RED,
> +        CRITICAL: RED,
> +    }
>
>
> Most of the time terminals are either "dark" or "light", and default color
> is always set to -1 in the curses interface.  For example, the attached
> patch will allow the patch to work on my "lawngreen" default xterms as well
> as more typical defaults for gnome-terminal or rxvt.
>
> Cheers,
> Jason.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20121114/f496457b/attachment-0001.html>


More information about the bitbake-devel mailing list