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
ae09f609
Commit
ae09f609
authored
Feb 24, 2015
by
J. Fernando Sánchez
Browse files
Improved message when no plugins are found
parent
d1006bbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
senpy/extensions.py
View file @
ae09f609
...
...
@@ -68,10 +68,10 @@ class Senpy(object):
algo
=
params
[
"algorithm"
]
elif
self
.
plugins
:
algo
=
self
.
default_plugin
and
self
.
default_plugin
.
name
if
not
algo
:
return
Error
(
status
=
404
,
message
=
(
"No plugins found."
" Please install one."
).
format
(
algo
))
if
not
algo
:
return
Error
(
status
=
404
,
message
=
(
"No plugins found."
" Please install one."
).
format
(
algo
))
if
algo
in
self
.
plugins
:
if
self
.
plugins
[
algo
].
is_activated
:
plug
=
self
.
plugins
[
algo
]
...
...
@@ -88,7 +88,7 @@ class Senpy(object):
logger
.
debug
((
"The algorithm '{}' is not valid
\n
"
"Valid algorithms: {}"
).
format
(
algo
,
self
.
plugins
.
keys
()))
return
Error
(
status
=
40
0
,
return
Error
(
status
=
40
4
,
message
=
"The algorithm '{}' is not valid"
.
format
(
algo
))
...
...
setup.py
View file @
ae09f609
...
...
@@ -8,7 +8,7 @@ install_reqs = parse_requirements("requirements.txt")
# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
reqs
=
[
str
(
ir
.
req
)
for
ir
in
install_reqs
]
VERSION
=
"0.4.
0
"
VERSION
=
"0.4.
1
"
print
(
reqs
)
...
...
tests/extensions_test/__init__.py
View file @
ae09f609
...
...
@@ -75,6 +75,7 @@ class ExtensionsTest(TestCase):
resp
=
self
.
senpy
.
analyse
(
input
=
"tupni"
)
logging
.
debug
(
"Response: {}"
.
format
(
resp
))
assert
resp
[
"status"
]
==
404
def
test_filtering
(
self
):
""" Filtering plugins """
...
...
Write
Preview
Markdown
is supported
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