credits: use comma grouping when representing number of commits

Use format(..) instead of percentage formatting.
This commit is contained in:
Campbell Barton
2023-01-11 23:22:40 +11:00
parent 1567187c76
commit 3582f5326d

View File

@ -150,14 +150,14 @@ class Credits:
with open(filepath, 'w', encoding="ascii", errors='xmlcharrefreplace') as file:
file.write("<h3>Individual Contributors</h3>\n\n")
for author, cu in sorted_authors.items():
file.write("%s, %d %s %s<br />\n" %
(author,
cu.commit_total,
commit_word[cu.commit_total > 1],
("" if not is_main_credits else (
("- %d" % cu.year_min) if cu.year_min == cu.year_max else
("(%d - %d)" % (cu.year_min, cu.year_max))))))
file.write("\n\n")
file.write("{:s}, {:,d} {:s} {:s}<br />\n".format(
author,
cu.commit_total,
commit_word[cu.commit_total > 1],
("" if not is_main_credits else
("- {:d}".format(cu.year_min) if cu.year_min == cu.year_max else
("({:d} - {:d})".format(cu.year_min, cu.year_max))))))
file.write("\n\n")
# -------------------------------------------------------------------------
# Companies, hard coded
@ -165,14 +165,16 @@ class Credits:
file.write("<h3>Contributions from Companies & Organizations</h3>\n")
file.write("<p>\n")
for line in contrib_companies:
file.write("%s<br />\n" % line)
file.write("{:s}<br />\n".format(line))
file.write("</p>\n")
import datetime
now = datetime.datetime.now()
fn = __file__.split("\\")[-1].split("/")[-1]
file.write("<p><center><i>Generated by '%s' %d/%d/%d</i></center></p>\n" %
(fn, now.year, now.month, now.day))
file.write(
"<p><center><i>Generated by '{:s}' {:d}/{:d}/{:d}</i></center></p>\n".format(
fn, now.year, now.month, now.day
))
def argparse_create():