From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: tomasz.mistat@intel.com, jari.tahvanainen@intel.com
Subject: [igt-dev] [PATCH i-g-t v5 11/11] scripts/doc_to_xls.py: improve XLS output format
Date: Fri, 8 Sep 2023 12:31:53 +0200 [thread overview]
Message-ID: <20230908103218.1089792-12-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230908103218.1089792-1-mauro.chehab@linux.intel.com>
From: Mauro Carvalho Chehab <mchehab@kernel.org>
- Use a bold font for column names;
- enable auto-filter;
- make it backward compatible with versions of openpyxl
shipped on LTS distros.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/doc_to_xls.py | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/scripts/doc_to_xls.py b/scripts/doc_to_xls.py
index 3af3488928cf..c2eaef8fd4b4 100755
--- a/scripts/doc_to_xls.py
+++ b/scripts/doc_to_xls.py
@@ -25,6 +25,8 @@ Examples:
import argparse
from openpyxl import Workbook
+from openpyxl.utils import get_column_letter
+from openpyxl.styles import Font
from test_list import TestList
@@ -70,17 +72,21 @@ for row in range(len(tests)):
for row in range(len(sheet)):
for col in range(len(sheet[row])):
- ws.cell(row = row + 1, column = col + 1, value = sheet[row][col])
+ c = ws.cell(row = row + 1, column = col + 1, value = sheet[row][col])
+ if row == 0:
+ c.font = Font(bold=True)
+
if len(sheet[row][col]) > max_length[col]:
max_length[col] = len(sheet[row][col])
- col = 0
- for c in ws.columns:
- column = c[0].column_letter
+ # Estimate column length
+ for col in range(len(sheet[0])):
+ column = get_column_letter(col + 1)
adjusted_width = (max_length[col] + 2) * 1.2
ws.column_dimensions[column].width = adjusted_width
- col += 1
+ # Turn on auto-filter
+ ws.auto_filter.ref = ws.dimensions
wb.save(parse_args.xls)
--
2.41.0
next prev parent reply other threads:[~2023-09-08 10:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 10:31 [igt-dev] [PATCH i-g-t v5 00/11] Xe: set Run type from testlist instead of defining it Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 01/11] test_list.py: add support for reading testlist regular expressions Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 02/11] xe_test_config.json: add testlists and blocklists Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 03/11] kms_test_config.json: " Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 04/11] tests: Intel Xe: drop Run type field Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 05/11] tests: Intel KMS: " Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 06/11] scripts/test_list.py: move "FULL" testlist to config file Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 07/11] scripts/test_list.py: don't be greedy while matching data from testlists Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 08/11] scripts/test_list.py: fix gen_testlist logic Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 09/11] scripts/test_list.py: add support for expanding fields on spreadsheet Mauro Carvalho Chehab
2023-09-08 10:31 ` [igt-dev] [PATCH i-g-t v5 10/11] scripts/doc_to_xls.py: expand GPU excluded platform Mauro Carvalho Chehab
2023-09-08 10:31 ` Mauro Carvalho Chehab [this message]
2023-09-08 11:15 ` [igt-dev] ✓ Fi.CI.BAT: success for Xe: set Run type from testlist instead of defining it Patchwork
2023-09-08 11:16 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-09-08 17:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230908103218.1089792-12-mauro.chehab@linux.intel.com \
--to=mauro.chehab@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jari.tahvanainen@intel.com \
--cc=tomasz.mistat@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox