41def construct_body(result):
42
43 title = result['title']
44
45
46 content = """{title} - {authors} {journal} ({volume}) {page} ({year})"""
47
48
49 try:
50 if result['journal']:
51 content = content.format(
52 title=result['citation_title'],
53 authors=result['entry_author_list'][0],
54 journal=result['journal'],
55 volume=result['journal_volume'],
56 page=result['journal_page'],
57 year=result['citation_year'],
58 )
59 else:
60 content = content.format(
61 title=result['citation_title'],
62 authors=result['entry_author_list'][0],
63 journal='',
64 volume='',
65 page='',
66 year=result['release_year'],
67 )
68 thumbnail = pdbe_preview_url.format(pdb_id=result['pdb_id'])
69 except KeyError:
70 content = None
71 thumbnail = None
72
73
74 try:
75 thumbnail = pdbe_preview_url.format(pdb_id=result['pdb_id'])
76 except KeyError:
77 thumbnail = None
78
79 return [title, content, thumbnail]
80
81