From b02c0c0d7471e2884852871703a98cd67cb9f16a Mon Sep 17 00:00:00 2001 From: David Michaels Date: Thu, 18 Apr 2024 19:17:14 -0400 Subject: [PATCH] minor progress_bar update --- dcicutils/progress_bar.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dcicutils/progress_bar.py b/dcicutils/progress_bar.py index 1d9089ab8..fd52af84a 100644 --- a/dcicutils/progress_bar.py +++ b/dcicutils/progress_bar.py @@ -335,9 +335,15 @@ def restore_stdout_write() -> None: # noqa nonlocal sys_stdout_write if sys_stdout_write is not None: sys.stdout.write = sys_stdout_write + def ascii_spinners() -> list: # noqa + # Fun with ASCII spinners. + return list("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏") # borrowed from rich python package + # return list("⣾⣽⣻⢿⡿⣟⣯⣷") # borrowed from rich python package + # return list("⠿⠻⠽⠾⠷⠯⠟") + # return list("⠏⠛⠹⠼⠶⠧") + # return list("⠻⠽⠾⠷⠯⠟") + # return list("|/—◦\\") sys.stdout.write = tidy_stdout_write - # spina = ["|", "/", "—", "◦", "\\"] - spina = ["⠿", "⠻", "⠽", "⠾", "⠷", "⠯", "⠟"] - spini = 0 ; spinn = len(spina) # noqa + spina = ascii_spinners() ; spini = 0 ; spinn = len(spina) # noqa sentinel = "[progress]" ; sentinel_internal = f"{sentinel}:" # noqa return namedtuple("tidy_output_hack", ["restore", "sentinel"])(restore_stdout_write, sentinel)