diff --git a/extra/weekly_commits_table.py b/extra/weekly_commits_table.py index 46d5aad754..67dda2625d 100644 --- a/extra/weekly_commits_table.py +++ b/extra/weekly_commits_table.py @@ -11,19 +11,19 @@ cmd = ["git","-C",REPO,"log","--use-mailmap","--since=7 days ago","--no-merges", "--date=short","--pretty=%ad%x09%aN%x09%ae"] out = subprocess.run(cmd, capture_output=True, text=True).stdout.splitlines() for line in out: - try: d, name, email = line.split("\t") - except: continue - if d in seen: - low = (name+" "+email).lower() - for n in NAMES: - if n.lower() in low: seen[d][n] = True + try: d, name, email = line.split("\t") + except: continue + if d in seen: + low = (name+" "+email).lower() + for n in NAMES: + if n.lower() in low: seen[d][n] = True # --- width-aware padding so emoji align --- try: - from wcwidth import wcswidth as _wcswidth - vlen = lambda s: _wcswidth(s) + from wcwidth import wcswidth as _wcswidth + vlen = lambda s: _wcswidth(s) except Exception: - vlen = lambda s: sum(2 if ch in "✅❌" else 1 for ch in s) + vlen = lambda s: sum(2 if ch in "✅❌" else 1 for ch in s) pad = lambda s,w: s + " " * max(0, w - vlen(s)) w_date = 10 @@ -34,8 +34,8 @@ rule = "-+-".join(["-"*w_date] + ["-"*w for w in w_cols]) rows=[] for d in days: - cells = ["✅" if seen[d][n] else "❌" for n in NAMES] - rows.append(" | ".join([pad(d, w_date)] + [pad(c, w_cols[i]) for i,c in enumerate(cells)])) + cells = ["✅" if seen[d][n] else "❌" for n in NAMES] + rows.append(" | ".join([pad(d, w_date)] + [pad(c, w_cols[i]) for i,c in enumerate(cells)])) print("** Commits by day (last 7) **") print("```")