MCPcopy
hub / github.com/epinna/tplmap / postfunc

Function postfunc

tests/env_py_tests/webserver.py:64–75  ·  view source on GitHub ↗
(engine)

Source from the content-addressed store, hash-verified

62
63@app.route("/post/<engine>", methods = [ "POST" ])
64def postfunc(engine):
65
66 template = request.values.get('tpl')
67 if not template:
68 template = '%s'
69
70 injection = request.values.get('inj')
71
72 if engine == 'mako':
73 return randomword() + MakoTemplates(template % injection, lookup=mylookup).render() + randomword()
74 elif engine == 'jinja2':
75 return randomword() + Jinja2Env.from_string(template % injection).render() + randomword()
76
77
78@app.route("/header/<engine>")

Callers

nothing calls this directly

Calls 3

randomwordFunction · 0.85
getMethod · 0.80
renderMethod · 0.80

Tested by

no test coverage detected