def index(): query = request.args.get('query') if not query: return render_template('index.html', br_cutoff = str(br_cutoff), max_decay_chain = max_decay_chain) query = [x for x in query.split(' ') if x != ''] start = datetime.now() results = do_search(query) end = datetime.now() return render_template('results.html', query=request.args.get('query'), results=results, timing=(end - start))
def txt(query): if not query: return redirect('/') query = [x for x in query.split(' ') if x != ''] start = datetime.now() result = do_search(query) end = datetime.now() for r in result: r['branching'] = nice_br(r['branching']) #r['branching'] = "%0.4g" % r['branching'] #r['branching'] = "%0.4g" % r['branching'][0] return Response(TablePrinter(format, ul='-')(result), mimetype='text/plain')
def json(query): if not query: return redirect('/') query = [x for x in query.split(' ') if x != ''] start = datetime.now() result = do_search(query) end = datetime.now() for r in result: r['branching'] = nice_br(r['branching']) #r['branching'] = "%0.4g" % r['branching'] p_list = {} for p in Particle.objects(): p_list[p.to_dict()["name"]]=p.to_print() return Response(json_dump({'result' : result, 'time': str(end-start), 'p_list':p_list}), mimetype='application/json')