Commit f51c8122 authored by snuverink_j's avatar snuverink_j
Browse files

for #8: exit if optimiser command is used with runOPAL

parent 62a68eb1
...@@ -161,14 +161,24 @@ def main(argv): ...@@ -161,14 +161,24 @@ def main(argv):
baseFileName = getBaseName() baseFileName = getBaseName()
if os.environ.get('TEMPLATES'):
if os.path.isfile(baseFileName + ".tmpl"):
os.system("mv " + baseFileName + ".tmpl tmplbak17.tmpl")
dataFile = baseFileName + '.data' dataFile = baseFileName + '.data'
tmplFile = baseFileName + '.tmpl' tmplFile = baseFileName + '.tmpl'
oinpFile = baseFileName + '.in' # the resulting OPAL input file oinpFile = baseFileName + '.in' # the resulting OPAL input file
# Optimizer and Sample command currently not compatible with runOPAL (issue #8)
templateFile = open(tmplFile,'r')
for line in templateFile:
if line.startswith('//'):
continue
if 'OPTIMIZE,' in line or 'SAMPLE,' in line:
print('OPTIMIZE and SAMPLE command currently not compatible with runOPAL')
sys.exit()
templateFile.close()
if os.environ.get('TEMPLATES'):
if os.path.isfile(baseFileName + ".tmpl"):
os.system("mv " + baseFileName + ".tmpl tmplbak17.tmpl")
#create the dictionary #create the dictionary
opaldict = OpalDict(dataFile) opaldict = OpalDict(dataFile)
# check if template values must be changed # check if template values must be changed
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment