chore: Refine ASCII spinner animation

This commit is contained in:
Paul Gauthier 2025-05-08 19:49:19 -07:00 committed by Paul Gauthier (aider)
parent 7a5877ea50
commit 4d5852a30e

View file

@ -270,18 +270,18 @@ class Spinner:
# Pre-render the animation frames using pure ASCII so they will # Pre-render the animation frames using pure ASCII so they will
# always display, even on very limited terminals. # always display, even on very limited terminals.
ascii_frames = [ ascii_frames = [
" #= | ", "#= ",
" =# | ", "=# ",
" =# | ", " =# ",
" =# | ", " =# ",
" =# | ", " =# ",
" =# | ", " =# ",
" =# | ", " =#",
" #= | ", " #=",
" #= | ", " #= ",
" #= | ", " #= ",
" #= | ", " #= ",
" #= | ", " #= ",
] ]
self.unicode_palette = "≋≣" self.unicode_palette = "≋≣"
@ -446,10 +446,11 @@ def printable_shell_command(cmd_list):
def main(): def main():
spinner = Spinner("Running spinner...") spinner = Spinner("Running spinner...")
for _ in range(300): for _ in range(100):
time.sleep(0.15) time.sleep(0.15)
spinner.step() spinner.step()
spinner.end() spinner.end()
print("Success!")
if __name__ == "__main__": if __name__ == "__main__":