bin/gla11y | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
New commits: commit 372b109f4d90dca7bb53f93bc597ce1dd8ba5898 Author: Samuel Thibault <samuel.thiba...@ens-lyon.org> AuthorDate: Sat Jul 4 22:54:55 2020 +0200 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Tue Jul 7 14:12:26 2020 +0200 gla11y: improve warning printing Also print the howto URL in messages about suppressed warnings When showing suppression lines, also print the suppression file name. Change-Id: I72da4149c505cec04bf715791f45a2b809d3ce63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97989 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/bin/gla11y b/bin/gla11y index f2dfbbdf81b2..80d3e54a371c 100755 --- a/bin/gla11y +++ b/bin/gla11y @@ -41,6 +41,8 @@ except ImportError: import xml.etree.ElementTree as ET lxml = False +howto_url = "https://wiki.documentfoundation.org/Development/Accessibility" + # Toplevel widgets widgets_toplevel = [ 'GtkWindow', @@ -1376,7 +1378,7 @@ def main(): continue prefix = line.rstrip() suppressions[prefix] = True - suppressions_to_line[prefix] = line_no + suppressions_to_line[prefix] = "%s:%u" % (suppr, line_no) supprfile.close() except IOError: pass @@ -1429,19 +1431,19 @@ def main(): if errors > 0 or errexists > 0: output_buffer += "%s new error%s" % (errors, 's' if errors != 1 else '') if errexists > 0: - output_buffer += " (%s suppressed)" % (errexists) + output_buffer += " (%s suppressed by %s, please fix %s)" % (errexists, suppr, 'them' if errexists > 1 else 'it') output_buffer += "\n" if warnings > 0 or warnexists > 0: output_buffer += "%s new warning%s" % (warnings, 's' if warnings != 1 else '') if warnexists > 0: - output_buffer += " (%s suppressed)" % (warnexists) + output_buffer += " (%s suppressed by %s, please fix %s)" % (warnexists, suppr, 'them' if warnexists > 1 else 'it') output_buffer += "\n" if fatals > 0 or fatalexists > 0: output_buffer += "%s new fatal%s" % (fatals, 's' if fatals != 1 else '') if fatalexists > 0: - output_buffer += " (%s suppressed)" % (fatalexists) + output_buffer += " (%s suppressed by %s, please fix %s)" % (fatalexists, suppr, 'them' if fatalexists > 1 else 'it') output_buffer += "\n" n = 0 @@ -1459,10 +1461,14 @@ def main(): gen_supprfile.close() if outfile is not None: outfile.close() - if fatals > 0 and gen_suppr is None: - output_buffer += "Explanations are available on https://wiki.documentfoundation.org/Development/Accessibility" - print(output_header.rstrip() + "\n" + output_buffer) - sys.exit(1) + + if gen_suppr is None: + if output_buffer != "": + output_buffer += "Explanations are available on " + howto_url + "\n" + + if fatals > 0: + print(output_header.rstrip() + "\n" + output_buffer) + sys.exit(1) if len(output_buffer) > 0: print(output_header.rstrip() + "\n" + output_buffer) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits