mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-22 08:12:27 +00:00
Fix changes in blueprints api for showing help
This commit is contained in:
parent
aaad5e8f2b
commit
7f44f9e85d
@ -43,7 +43,6 @@ def get_params(req):
|
|||||||
raise Error(message="Invalid data")
|
raise Error(message="Invalid data")
|
||||||
return indict
|
return indict
|
||||||
|
|
||||||
|
|
||||||
@demo_blueprint.route('/')
|
@demo_blueprint.route('/')
|
||||||
def index():
|
def index():
|
||||||
return render_template("index.html", version=__version__)
|
return render_template("index.html", version=__version__)
|
||||||
@ -117,6 +116,16 @@ def basic_api(f):
|
|||||||
@api_blueprint.route('/', methods=['POST', 'GET'])
|
@api_blueprint.route('/', methods=['POST', 'GET'])
|
||||||
@basic_api
|
@basic_api
|
||||||
def api():
|
def api():
|
||||||
|
phelp = request.params.get('help')
|
||||||
|
if phelp == "True":
|
||||||
|
dic = {'WEB_PARAMS': WEB_PARAMS,
|
||||||
|
'CLI_PARAMS': CLI_PARAMS,
|
||||||
|
'NIF_PARAMS': NIF_PARAMS,
|
||||||
|
'API_PARAMS': API_PARAMS
|
||||||
|
}
|
||||||
|
response = Response(dic)
|
||||||
|
return response
|
||||||
|
else:
|
||||||
response = current_app.senpy.analyse(**request.params)
|
response = current_app.senpy.analyse(**request.params)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -144,21 +153,3 @@ def plugin(plugin=None):
|
|||||||
else:
|
else:
|
||||||
return Error(message="Plugin not found", status=404)
|
return Error(message="Plugin not found", status=404)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@api_blueprint.route('/params/', methods=['POST', 'GET'])
|
|
||||||
@basic_api
|
|
||||||
def params():
|
|
||||||
phelp = request.params.get('help')
|
|
||||||
if eval(phelp):
|
|
||||||
dic = {'WEB_PARAMS': WEB_PARAMS,
|
|
||||||
'CLI_PARAMS': CLI_PARAMS,
|
|
||||||
'NIF_PARAMS': NIF_PARAMS,
|
|
||||||
'API_PARAMS': API_PARAMS
|
|
||||||
}
|
|
||||||
response = Response(dic)
|
|
||||||
return response
|
|
||||||
else:
|
|
||||||
response = Response(request.params)
|
|
||||||
return response
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user