diff options
Diffstat (limited to 'docs/release/scripts/minimaws/lib/wsgiserve.py')
-rw-r--r-- | docs/release/scripts/minimaws/lib/wsgiserve.py | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/docs/release/scripts/minimaws/lib/wsgiserve.py b/docs/release/scripts/minimaws/lib/wsgiserve.py index 43d5dbc1253..1158528d954 100644 --- a/docs/release/scripts/minimaws/lib/wsgiserve.py +++ b/docs/release/scripts/minimaws/lib/wsgiserve.py @@ -661,6 +661,20 @@ class SoftwareListHandler(QueryPageHandler): unsupported=htmlescape('%d' % (softwarelist_info['unsupported'], )), unsupportedpc=htmlescape('%.1f' % (softwarelist_info['unsupported'] * 100.0 / (softwarelist_info['total'] or 1), ))).encode('utf-8') + if softwarelist_info['notes'] is not None: + yield htmltmpl.SOFTWARELIST_NOTES_PROLOGUE.substitute().encode('utf-8') + first = True + for line in softwarelist_info['notes'].strip().splitlines(): + if line: + yield (('<p>%s' if first else '<br />\n%s') % (htmlescape(line), )).encode('utf-8') + first = False + elif not first: + yield '</p>\n'.encode('utf-8') + first = True + if not first: + yield '</p>\n'.encode('utf-8') + yield htmltmpl.SOFTWARELIST_NOTES_EPILOGUE.substitute().encode('utf-8') + first = True for machine_info in self.dbcurs.get_softwarelist_machines(softwarelist_info['id']): if first: @@ -719,19 +733,35 @@ class SoftwareListHandler(QueryPageHandler): yield htmltmpl.SORTABLE_TABLE_EPILOGUE.substitute(id='tbl-clones').encode('utf-8') yield '<script>make_collapsible(document.getElementById("heading-clones"), document.getElementById("tbl-clones"));</script>\n'.encode('utf-8') + if software_info['notes'] is not None: + yield htmltmpl.SOFTWARE_NOTES_PROLOGUE.substitute().encode('utf-8') + first = True + for line in software_info['notes'].strip().splitlines(): + if line: + yield (('<p>%s' if first else '<br />\n%s') % (htmlescape(line), )).encode('utf-8') + first = False + elif not first: + yield '</p>\n'.encode('utf-8') + first = True + if not first: + yield '</p>\n'.encode('utf-8') + yield htmltmpl.SOFTWARE_NOTES_EPILOGUE.substitute().encode('utf-8') + parts = self.dbcurs.get_software_parts(software_info['id']).fetchall() first = True for id, partname, interface, part_id in parts: if first: - yield '<h2>Parts</h2>\n'.encode('utf-8') + yield htmltmpl.SOFTWARE_PARTS_PROLOGUE.substitute().encode('utf-8') first = False yield htmltmpl.SOFTWARE_PART_PROLOGUE.substitute( heading=htmlescape(('%s (%s)' % (part_id, partname)) if part_id is not None else partname), shortname=htmlescape(partname), interface=htmlescape(interface)).encode('utf-8') for name, value in self.dbcurs.get_softwarepart_features(id): - yield (' <tr><th>%s:</th><td>%s</td>\n' % (htmlescape(name), htmlescape(value))).encode('utf-8') - yield '</table>\n\n'.encode('utf-8') + yield (' <tr><th>%s:</th><td>%s</td>\n' % (htmlescape(name), htmlescape(value))).encode('utf-8') + yield ' </table>\n\n'.encode('utf-8') + if not first: + yield htmltmpl.SOFTWARE_PARTS_EPILOGUE.substitute().encode('utf-8') yield '</body>\n</html>\n'.encode('utf-8') |