forked from zaclys/searxng
[fix] multiple fixes in pdbe engine
This commit is contained in:
parent
0969e50c5b
commit
801b5a56ad
|
@ -43,7 +43,7 @@ def construct_body(result):
|
||||||
title = result['title']
|
title = result['title']
|
||||||
|
|
||||||
# construct content body
|
# construct content body
|
||||||
content = """{title}<br />{authors} {journal} <strong>{volume}</strong> {page} ({year})"""
|
content = """{title} - {authors} {journal} ({volume}) {page} ({year})"""
|
||||||
|
|
||||||
# replace placeholders with actual content
|
# replace placeholders with actual content
|
||||||
try:
|
try:
|
||||||
|
@ -84,15 +84,18 @@ def response(resp):
|
||||||
continue
|
continue
|
||||||
if result['status'] == 'OBS':
|
if result['status'] == 'OBS':
|
||||||
# expand title to add some sort of warning message
|
# expand title to add some sort of warning message
|
||||||
title = gettext('{title} (OBSOLETE)').format(title=result['title'])
|
title = gettext('{title} (OBSOLETE)').format(title=result['title'])
|
||||||
superseded_url = pdbe_entry_url.format(pdb_id=result['superseded_by'])
|
try:
|
||||||
|
superseded_url = pdbe_entry_url.format(pdb_id=result['superseded_by'])
|
||||||
|
except:
|
||||||
|
continue
|
||||||
|
|
||||||
# since we can't construct a proper body from the response, we'll make up our own
|
# since we can't construct a proper body from the response, we'll make up our own
|
||||||
msg_superseded = gettext("This entry has been superseded by")
|
msg_superseded = gettext("This entry has been superseded by")
|
||||||
content = '<em>{msg_superseded} \<a href="{url}">{pdb_id}</a></em>'.format(
|
content = '{msg_superseded}: {url} ({pdb_id})'.format(
|
||||||
msg_superseded=msg_superseded,
|
msg_superseded=msg_superseded,
|
||||||
url=superseded_url,
|
url=superseded_url,
|
||||||
pdb_id=result['superseded_by'], )
|
pdb_id=result['superseded_by'])
|
||||||
|
|
||||||
# obsoleted entries don't have preview images
|
# obsoleted entries don't have preview images
|
||||||
img_src = None
|
img_src = None
|
||||||
|
|
Loading…
Reference in New Issue