laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/pysim/+/15498 )

Change subject: pySim-prog: use case insensitive CSV headers.
......................................................................

pySim-prog: use case insensitive CSV headers.

Inside of pySim all CSV headers are defined in lower case and are
evaluated case sensitive. This means that a CSV file that contains the
headers in uppercase for example will not parse. Lets make sure that the
CSV headers are evaluated case insensitive to increase compatibility
with slightly different formats.

Change-Id: I1a476e7fc521d1aad2956feec3db196156961d20
---
M pySim-prog.py
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim-prog.py b/pySim-prog.py
index 2387986..e92654d 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -456,6 +456,10 @@
        import csv
        f = open(opts.read_csv, 'r')
        cr = csv.DictReader(f)
+
+       # Lower-case fieldnames
+       cr.fieldnames = [ field.lower() for field in cr.fieldnames ]
+
        i = 0
         if not 'iccid' in cr.fieldnames:
             raise Exception("CSV file in wrong format!")

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/15498
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1a476e7fc521d1aad2956feec3db196156961d20
Gerrit-Change-Number: 15498
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillm...@sysmocom.de>
Gerrit-Reviewer: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@gnumonks.org>
Gerrit-MessageType: merged

Reply via email to