Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
senpy
senpy
Commits
7f44f9e8
Commit
7f44f9e8
authored
Jul 14, 2017
by
militarpancho
Browse files
Fix changes in blueprints api for showing help
parent
aaad5e8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
senpy/blueprints.py
View file @
7f44f9e8
...
...
@@ -43,7 +43,6 @@ def get_params(req):
raise
Error
(
message
=
"Invalid data"
)
return
indict
@
demo_blueprint
.
route
(
'/'
)
def
index
():
return
render_template
(
"index.html"
,
version
=
__version__
)
...
...
@@ -117,8 +116,18 @@ def basic_api(f):
@
api_blueprint
.
route
(
'/'
,
methods
=
[
'POST'
,
'GET'
])
@
basic_api
def
api
():
response
=
current_app
.
senpy
.
analyse
(
**
request
.
params
)
return
response
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
)
return
response
@
api_blueprint
.
route
(
'/plugins/'
,
methods
=
[
'POST'
,
'GET'
])
...
...
@@ -144,21 +153,3 @@ def plugin(plugin=None):
else
:
return
Error
(
message
=
"Plugin not found"
,
status
=
404
)
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment