def returned(): "returns json format results, no markup" from interpcry import cry_pipeline sInput = request.args.get('sInput') dRet = cry_pipeline.interp_cry(sInput, iResample=None) os.remove(sInput) import json return json.dumps(dRet)
def returned_gui(): """returns the results with some markup for the GUI""" from datetime import datetime as dt oBegin = dt.now() from interpcry import cry_pipeline sInput = request.args.get('sInput') dRet = cry_pipeline.interp_cry(sInput, iResample=None) os.remove(sInput) ldRet = [{'sCry':dRet['lsNames'][i], 'sConfidence': dRet['liValues'][i]} for i in range(len(dRet['lsNames']))] import json sTimeDelta = str(dt.now() - oBegin) return render_template('results.html', sTime = sTimeDelta, sUploadURL = "/upload", ldRet = ldRet)