Skip to content

Commit

Permalink
minor progress_bar update
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Apr 18, 2024
1 parent 6b1a142 commit b02c0c0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions dcicutils/progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit b02c0c0

Please sign in to comment.