diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2019-09-12 11:49:44 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2019-09-13 10:29:59 +0200 |
commit | 196b08cdfdd6b5ee8c75a86f510514b99dd383d2 (patch) | |
tree | 4050e4caf09e43ecfae8dd44628108c4a180399d /pySim-prog.py | |
parent | 120a000e86e3adf2f8506c5ca958cff7a0ad16d0 (diff) |
pySim-prog: check if CSV file exists
At the moment we do not chack if the CSV file exists at all. This may
lead into a crash while programming the card. Lets check the CSV file
before we start.
Change-Id: I2643996282d88e512c17901ab0e1181677d5dd6c
Related: SYS#4654
Diffstat (limited to 'pySim-prog.py')
-rwxr-xr-x | pySim-prog.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pySim-prog.py b/pySim-prog.py index e92654d..ee5bc98 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -712,6 +712,13 @@ if __name__ == '__main__': # Create command layer scc = SimCardCommands(transport=sl) + # If we use a CSV file as data input, check if the CSV file exists. + if opts.source == 'csv': + print "Using CSV file as data input: " + str(opts.read_csv) + if not os.path.isfile(opts.read_csv): + print "CSV file not found!" + sys.exit(1) + # Batch mode init init_batch(opts) |