From 90e6893b967cded4bf45380d643d3bfcb19ce0d4 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Tue, 18 Apr 2017 18:57:14 +0800 Subject: Set default width to 80 for justify filter - 80 default screen width for most consoles - template content should not be part of console reporter test - remove fix width splitter in console report templates Change-Id: Ib060b447bd52c211a4bf1e4ded2f898a9201b6d8 Signed-off-by: Yujun Zhang --- qtip/reporter/filters.py | 2 +- qtip/reporter/templates/base.j2 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'qtip') diff --git a/qtip/reporter/filters.py b/qtip/reporter/filters.py index dc46e195..c0c379df 100644 --- a/qtip/reporter/filters.py +++ b/qtip/reporter/filters.py @@ -8,7 +8,7 @@ ############################################################################## -def justify(pair, width=100, padding_with='.'): +def justify(pair, width=80, padding_with='.'): """align first element along the left margin, second along the right, padding spaces""" n = width - len(pair[0]) return '{key}{value:{c}>{n}}'.format(key=pair[0], value=pair[1], c=padding_with, n=n) diff --git a/qtip/reporter/templates/base.j2 b/qtip/reporter/templates/base.j2 index 34242b40..5dafc8b1 100644 --- a/qtip/reporter/templates/base.j2 +++ b/qtip/reporter/templates/base.j2 @@ -1,4 +1,4 @@ -{{ '=' * 100}} +{{ ('=', '=')|justify }} {{ ('Plan Name', plan_name)|justify }} {{ ('Start Time', start_time)|justify }} {{ ('Stop Time', stop_time)|justify }} @@ -14,7 +14,7 @@ {% include '%s.j2' % metric_name %} {% endif %} System Information -{{ ('CPU Brand', bm.sysinfo.cpu)|justify }} +{{ ('CPU', bm.sysinfo.cpu)|justify }} {{ ('Disk', bm.sysinfo.disk)|justify }} {{ ('Host Name', bm.sysinfo.hostname)|justify }} {{ ('Kernel', bm.sysinfo.kernel)|justify }} @@ -25,5 +25,5 @@ System Information {%- endfor -%} {% endfor %} -{{ '\033[93m' }} {{ '*' * 100}} {{ '\033[0m' }} +{{ ('\033[93m*', '*\033[0m')|justify }} {%- endfor -%} -- cgit 1.2.3-korg