diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2019-09-12 13:11:45 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2019-09-13 10:29:59 +0200 |
commit | 120a000e86e3adf2f8506c5ca958cff7a0ad16d0 (patch) | |
tree | 7d1faaedbf21c034c5be6cc76a38f971d0fec93e /pySim-prog.py | |
parent | 1de89bf889bd9060f39efb41a14059dc87577e9f (diff) |
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
Diffstat (limited to 'pySim-prog.py')
-rwxr-xr-x | pySim-prog.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 @@ def _read_params_csv(opts, iccid=None, imsi=None): 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!") |