put bar first, improve output

This commit is contained in:
Mark Eaton
2025-08-13 12:23:18 -04:00
parent 0138790d15
commit a40662195d
+3 -5
View File
@@ -70,9 +70,7 @@ lines = [
for lang, nbytes in pairs: for lang, nbytes in pairs:
pct = nbytes * 100 / total_bytes pct = nbytes * 100 / total_bytes
bar = "" * int(pct / 2) # up to 50 chars bar = "" * int(pct / 2) # up to 50 chars
lines.append(f"{lang} {bar} {pct:5.1f}% \n") lines.append(f"{bar} {lang}{pct:5.1f}%\\")
block = "<!--LANG_STATS_START-->\n" + "".join(lines) + "<!--LANG_STATS_END-->\n" for line in lines:
print(line)
# ---------- output markdown block ----------
print(block)