mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
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
This commit is contained in:
@@ -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!")
|
||||
|
||||
Reference in New Issue
Block a user