From a39ca3157f9b6cd42ad6548758542685723f802a Mon Sep 17 00:00:00 2001 From: veg Date: Sun, 31 May 2026 14:30:56 +0000 Subject: [PATCH] Show a determinate progress bar during export The export loop can run for a while on large lists. It already knows the message count up front, so draw a braille spinner + progress bar (frames and blue borrowed from warez) from inside the Python loop. Written to stderr so it never pollutes the captured MM3HK| stdout, gated on isatty() so cron/piped runs stay silent, throttled to ~10 fps, cleared in finally. Progress bytes never touch the mbox, so its SHA-256 is unaffected. --- mm3-hk-export | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/mm3-hk-export b/mm3-hk-export index 5177ecc..b4a4aed 100755 --- a/mm3-hk-export +++ b/mm3-hk-export @@ -73,7 +73,7 @@ EOF } result=$(mailman-web shell <= 0.1 or i == n: # ~10 fps, plus a final 100% frame + draw(i, spin); spin += 1; last = now finally: if GZIP: fh.close() # flush the gzip trailer into raw (does not close raw) raw.flush() + if tty: + sys.stderr.write("\r\033[K"); sys.stderr.flush() # clear the bar # Hash the on-disk bytes via the held fd, then hand root the digest so it can # verify the file wasn't swapped/truncated by another same-uid process before # it copies it. (A fully-compromised exporter is out of scope, since it controls