|
@@ -16,7 +16,7 @@ def main():
|
|
try:
|
|
try:
|
|
formFields = getFormFields(confFilePath)
|
|
formFields = getFormFields(confFilePath)
|
|
except:
|
|
except:
|
|
- return redirect(url_for('error'))
|
|
|
|
|
|
+ return redirect(url_for('error', message='no valid config file found'))
|
|
|
|
|
|
|
|
|
|
if request.method == 'POST':
|
|
if request.method == 'POST':
|
|
@@ -48,11 +48,11 @@ def main():
|
|
else:
|
|
else:
|
|
raise Exception("No data")
|
|
raise Exception("No data")
|
|
except:
|
|
except:
|
|
- return redirect(url_for('error'))
|
|
|
|
|
|
+ return redirect(url_for('error', message='no CSV data, or CSV input file missing required data'))
|
|
|
|
|
|
- return redirect(url_for('download', filename=outFileName))
|
|
|
|
|
|
+ return redirect(url_for('main', download=outFileName))
|
|
|
|
|
|
- return render_template('index.html', data=formFields)
|
|
|
|
|
|
+ return render_template('index.html.j2', data=formFields)
|
|
|
|
|
|
|
|
|
|
@app.route('/error/', methods=['POST','GET'])
|
|
@app.route('/error/', methods=['POST','GET'])
|
|
@@ -60,17 +60,15 @@ def error():
|
|
if request.method == 'POST':
|
|
if request.method == 'POST':
|
|
return redirect(url_for('main'))
|
|
return redirect(url_for('main'))
|
|
else:
|
|
else:
|
|
- return render_template('error.html')
|
|
|
|
|
|
+ return render_template('error.html.j2', message=request.args.get('message'))
|
|
|
|
|
|
|
|
|
|
-@app.route('/', methods=['POST', 'GET'])
|
|
|
|
|
|
+@app.route('/download/', methods=['POST', 'GET'])
|
|
def download():
|
|
def download():
|
|
appath = app.root_path + '/'
|
|
appath = app.root_path + '/'
|
|
outFileName = request.args.get('filename')
|
|
outFileName = request.args.get('filename')
|
|
outFilePath = appath + 'samples/RDF/' + outFileName
|
|
outFilePath = appath + 'samples/RDF/' + outFileName
|
|
return send_file(outFilePath, as_attachment=True)
|
|
return send_file(outFilePath, as_attachment=True)
|
|
-# return redirect(url_for('main', success=True))
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|