mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-22 08:12:27 +00:00
Improved message when no plugins are found
This commit is contained in:
parent
d1006bbc92
commit
ae09f609c2
@ -68,10 +68,10 @@ class Senpy(object):
|
|||||||
algo = params["algorithm"]
|
algo = params["algorithm"]
|
||||||
elif self.plugins:
|
elif self.plugins:
|
||||||
algo = self.default_plugin and self.default_plugin.name
|
algo = self.default_plugin and self.default_plugin.name
|
||||||
if not algo:
|
if not algo:
|
||||||
return Error(status=404,
|
return Error(status=404,
|
||||||
message=("No plugins found."
|
message=("No plugins found."
|
||||||
" Please install one.").format(algo))
|
" Please install one.").format(algo))
|
||||||
if algo in self.plugins:
|
if algo in self.plugins:
|
||||||
if self.plugins[algo].is_activated:
|
if self.plugins[algo].is_activated:
|
||||||
plug = self.plugins[algo]
|
plug = self.plugins[algo]
|
||||||
@ -88,7 +88,7 @@ class Senpy(object):
|
|||||||
logger.debug(("The algorithm '{}' is not valid\n"
|
logger.debug(("The algorithm '{}' is not valid\n"
|
||||||
"Valid algorithms: {}").format(algo,
|
"Valid algorithms: {}").format(algo,
|
||||||
self.plugins.keys()))
|
self.plugins.keys()))
|
||||||
return Error(status=400,
|
return Error(status=404,
|
||||||
message="The algorithm '{}' is not valid"
|
message="The algorithm '{}' is not valid"
|
||||||
.format(algo))
|
.format(algo))
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -8,7 +8,7 @@ install_reqs = parse_requirements("requirements.txt")
|
|||||||
# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
|
# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
|
||||||
reqs = [str(ir.req) for ir in install_reqs]
|
reqs = [str(ir.req) for ir in install_reqs]
|
||||||
|
|
||||||
VERSION = "0.4.0"
|
VERSION = "0.4.1"
|
||||||
|
|
||||||
print(reqs)
|
print(reqs)
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ class ExtensionsTest(TestCase):
|
|||||||
logging.debug("Response: {}".format(resp))
|
logging.debug("Response: {}".format(resp))
|
||||||
assert resp["status"] == 404
|
assert resp["status"] == 404
|
||||||
|
|
||||||
|
|
||||||
def test_filtering(self):
|
def test_filtering(self):
|
||||||
""" Filtering plugins """
|
""" Filtering plugins """
|
||||||
assert len(self.senpy.filter_plugins(name="Dummy")) > 0
|
assert len(self.senpy.filter_plugins(name="Dummy")) > 0
|
||||||
|
Loading…
Reference in New Issue
Block a user