[PATCH i-g-t 05/10] scripts/xls_to_doc.py: improve the addition logic
Kamil Konieczny
kamil.konieczny at linux.intel.com
Thu Mar 14 15:26:39 UTC 2024
Hi Mauro,
On 2024-03-14 at 11:29:14 +0100, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab at kernel.org>
>
> If the last line before inserting a new value is a blank comment,
> add the new fiels before that.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
> scripts/xls_to_doc.py | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/scripts/xls_to_doc.py b/scripts/xls_to_doc.py
> index a090dcffe98e..0aa774e811a3 100755
> --- a/scripts/xls_to_doc.py
> +++ b/scripts/xls_to_doc.py
> @@ -205,6 +205,9 @@ class FillTests(TestList):
> content[i] = ""
>
> if value != "":
> + if i > 2 and re.match(r'\s*\*\s*$', content[i - 1]):
> + i -= 1
> +
> content.insert(i, f' * {field}: {value}\n')
>
> def parse_spreadsheet(self, fname, sheets=None):
> --
> 2.43.2
>
More information about the igt-dev
mailing list