From d5e453edd3ed5eb1e4c4f29383a5aa588147a64c Mon Sep 17 00:00:00 2001 From: cbartondock Date: Wed, 31 Mar 2021 22:43:23 -0400 Subject: [PATCH] added scholarly to libraries in about page --- cps/about.py | 7 +++++++ cps/editbooks.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cps/about.py b/cps/about.py index 10e68e69..66c0ef40 100644 --- a/cps/about.py +++ b/cps/about.py @@ -54,6 +54,12 @@ try: except ImportError: greenlet_Version = None +try: + from scholarly import scholarly + scholarly_version = _(u'installed') +except ImportError: + scholarly_version = _(u'not installed') + from . import services about = flask.Blueprint('about', __name__) @@ -79,6 +85,7 @@ _VERSIONS = OrderedDict( iso639=isoLanguages.__version__, pytz=pytz.__version__, Unidecode = unidecode_version, + Scholarly = scholarly_version, Flask_SimpleLDAP = u'installed' if bool(services.ldap) else None, python_LDAP = services.ldapVersion if bool(services.ldapVersion) else None, Goodreads = u'installed' if bool(services.goodreads_support) else None, diff --git a/cps/editbooks.py b/cps/editbooks.py index 81e175b6..d9fd756f 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -1021,7 +1021,7 @@ def scholar_search(query): break return Response(json.dumps(result),mimetype='application/json') else: - return 'Scholarly not installed' + return []