From c2254001b5721422f032949add9da0a05ea62e5a Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 5 Aug 2024 19:31:01 -0300 Subject: [PATCH] fix: Remove unused Spinner class diff --git a/aider/io.py b/aider/io.py index ea4d25d0..d4d4d4d0 100644 --- a/aider/io.py +++ b/aider/io.py @@ -420,4 +420,4 @@ class InputOutput: f.write(text) def spinner(self, text): - return Spinner(text) + return Spinner(self, text) --- aider/io.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/aider/io.py b/aider/io.py index c0cb650c6..ea4d25d0e 100644 --- a/aider/io.py +++ b/aider/io.py @@ -23,33 +23,6 @@ from .dump import dump # noqa: F401 from .utils import is_image_file -class Spinner: - def __init__(self, io, text): - self.io = io - self.text = text - self.start_time = time.time() - self.last_update = 0 - self.visible = False - - def step(self): - current_time = time.time() - if not self.visible and current_time - self.start_time >= 0.5: - self.visible = True - self._step() - elif self.visible and current_time - self.last_update >= 0.1: - self._step() - self.last_update = current_time - - def _step(self): - if not self.visible: - return - - print(f"\r{self.text} {next(self.io.spinner_chars)}\r{self.text} ", end="", flush=True) - - def end(self): - if self.visible: - print("\r" + " " * (len(self.text) + 3)) - class AutoCompleter(Completer): def __init__(self, root, rel_fnames, addable_rel_fnames, commands, encoding): @@ -447,4 +420,4 @@ class InputOutput: f.write(text) def spinner(self, text): - return Spinner(self, text) + return Spinner(text)