[ck2cti] Improve error messages associated with missing input files

Partial cherry-pick of trunk r2856.
This commit is contained in:
Ray Speth 2014-04-29 19:02:02 +00:00
parent 953fc46c27
commit e59ca5ff6b

View file

@ -1796,6 +1796,8 @@ duplicate transport data) to be ignored.
if permissive is not None:
self.warning_as_error = not permissive
if not os.path.exists(inputFile):
raise IOError('Missing input file: {0!r}'.format(inputFile))
try:
# Read input mechanism files
self.loadChemkinFile(inputFile)
@ -1805,6 +1807,8 @@ duplicate transport data) to be ignored.
raise
if thermoFile:
if not os.path.exists(thermoFile):
raise IOError('Missing thermo file: {0!r}'.format(thermoFile))
try:
self.loadChemkinFile(thermoFile)
except Exception:
@ -1813,6 +1817,8 @@ duplicate transport data) to be ignored.
raise
if transportFile:
if not os.path.exists(transportFile):
raise IOError('Missing transport file: {0!r}'.format(transportFile))
lines = open(transportFile, 'rU').readlines()
self.parseTransportData(lines)