mirror of https://gerrit.osmocom.org/pysim
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
This commit is contained in:
parent
120a000e86
commit
196b08cdfd
|
@ -712,6 +712,13 @@ if __name__ == '__main__':
|
||||||
# Create command layer
|
# Create command layer
|
||||||
scc = SimCardCommands(transport=sl)
|
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
|
# Batch mode init
|
||||||
init_batch(opts)
|
init_batch(opts)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue