All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Katarzyna Piecielska <katarzyna.piecielska@intel.com>
Subject: [PATCH i-g-t 4/6] scripts/xls_to_doc.py: fix issues with python < 3.7
Date: Wed, 13 Mar 2024 08:56:07 +0100	[thread overview]
Message-ID: <20240313075813.1114081-5-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20240313075813.1114081-1-mauro.chehab@linux.intel.com>

From: Mauro Carvalho Chehab <mchehab@kernel.org>

The current logic relies on dict = sorted(dict) to preserve the
sorted order. Ordered dicts were introduced only on python 3.7.

This is a silly requirement, as all we want is to sort the
dict.item() tuple. Change the logic to avoid the need of
checking for an specific python version.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 scripts/xls_to_doc.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/xls_to_doc.py b/scripts/xls_to_doc.py
index 7ea92a344aff..cf2cfe2fe233 100755
--- a/scripts/xls_to_doc.py
+++ b/scripts/xls_to_doc.py
@@ -17,6 +17,7 @@ from openpyxl import load_workbook
 
 from test_list import TestList
 
+
 #
 # FillTests class definition
 #
@@ -127,7 +128,7 @@ class FillTests(TestList):
 
             self.process_spreadsheet_sheet(sheet)
 
-        return dict(sorted(self.spreadsheet_data.items()))
+        return self.spreadsheet_data
 
     def change_value(self, content, subtest, line, field, value):
 
@@ -190,7 +191,7 @@ class FillTests(TestList):
 
         data = self.read_spreadsheet_file(fname, sheets)
 
-        for test, row in data.items():
+        for test, row in sorted(data.items()):
             match = self.testname_regex.match(test)
             if not match:
                 sys.exit(f"Error: can't parse {test}")
-- 
2.43.2


  parent reply	other threads:[~2024-03-13  7:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13  7:56 [PATCH i-g-t 0/6] Do several cleanups at scripts/xls_to_doc.py Mauro Carvalho Chehab
2024-03-13  7:56 ` [PATCH i-g-t 1/6] scripts/xls_to_doc.py: use a main() function Mauro Carvalho Chehab
2024-03-13  7:56 ` [PATCH i-g-t 2/6] scripts/xls_to_doc.py: beautify its coding style Mauro Carvalho Chehab
2024-03-13  7:56 ` [PATCH i-g-t 3/6] scripts/xls_to_doc.py: cleanup argparse logic Mauro Carvalho Chehab
2024-03-13  7:56 ` Mauro Carvalho Chehab [this message]
2024-03-13  7:56 ` [PATCH i-g-t 5/6] scripts/xls_to_doc.py: document all functions Mauro Carvalho Chehab
2024-03-13  7:56 ` [PATCH i-g-t 6/6] scripts/xls_to_doc.py: don't be verbose by default Mauro Carvalho Chehab
2024-03-13  9:05 ` ✓ CI.xeBAT: success for Do several cleanups at scripts/xls_to_doc.py Patchwork
2024-03-13  9:09 ` ✓ Fi.CI.BAT: " Patchwork
2024-03-13 10:28 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-13 11:04 ` [PATCH i-g-t 0/6] " Piecielska, Katarzyna

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=20240313075813.1114081-5-mauro.chehab@linux.intel.com \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=katarzyna.piecielska@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.