• Samuel Huang's avatar
    [Metrics] Fix box drawing on Windows, and refactor code. · 98a7e803
    Samuel Huang authored
    The Unicode box drawing turn out malformed on Windows (even with
    fix_encoding.py). This CL refactors the box drawing code, and makes
    Windows box drawing use regular ASCII characters. Details:
    * Add print_red_boxed_text() to programatically print box aroun given
      list og strings.
      * Unicode box drawing characters are escaped, removing the use of
        non-ASCII characters in source code.
    * Convert message source to generators for greater flexibilty, and
      remove the need for manual horizontal padding.
    * Add proper use colorama with Style.BRIGNT and Style.RESET_ALL.
    * For Windows, revert to ASCII characters for box drawing.
    
    Change-Id: I71a728db480709b4376d538aaecd701f9197e7ac
    Reviewed-on: https://chromium-review.googlesource.com/c/1461249
    Commit-Queue: Samuel Huang <huangs@chromium.org>
    Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
    98a7e803
metrics_utils.py 9.04 KB