[webkit-reviews] review granted: [Bug 209850] [Flatpak SDK] Migration to version 0.2 : [Attachment 395154] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 1 04:07:29 PDT 2020


Carlos Alberto Lopez Perez <clopez at igalia.com> has granted Philippe Normand
<pnormand at igalia.com>'s request for review:
Bug 209850: [Flatpak SDK] Migration to version 0.2
https://bugs.webkit.org/show_bug.cgi?id=209850

Attachment 395154: Patch

https://bugs.webkit.org/attachment.cgi?id=395154&action=review




--- Comment #3 from Carlos Alberto Lopez Perez <clopez at igalia.com> ---
Comment on attachment 395154
  --> https://bugs.webkit.org/attachment.cgi?id=395154
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=395154&action=review

> Tools/flatpak/flatpakutils.py:103
> +    @classmethod
> +    def colored_message(cls, color, str_format, *args):
> +	   if args:
> +	       msg = str_format % args
> +	   else:
> +	       msg = str_format
> +
> +	   cls.message("\n%s%s%s", color, msg, Colors.ENDC)
> +
> +    @classmethod
> +    def error_message(cls, str_format, *args):
> +	   cls.colored_message(Colors.FAIL, str_format, *args)
> +
> +    @classmethod
> +    def warning_message(cls, str_format, *args):
> +	   cls.colored_message(Colors.WARNING, str_format, *args)

Our bots run with environment variable TERM=dumb to disable colored output,
since this ANSI colors looks bad on a text log.
Can you check if the terminal supports colors and only output ANSI color
characters in that case?
Here is a suggested code for that: http://sprunge.us/wSNHtz

And a test:

$ wget http://sprunge.us/wSNHtz
$ python wSNHtz
True

$ TERM=dumb python wSNHtz
False


More information about the webkit-reviews mailing list