From 44f3ed643303b529370dfee8349876e0440d48f3 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 5 Aug 2024 17:25:55 -0300 Subject: [PATCH] fix: Move Spinner class to top level and remove elapsed time display --- aider/io.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/aider/io.py b/aider/io.py index 374dcb5b4..c1c783dea 100644 --- a/aider/io.py +++ b/aider/io.py @@ -1,25 +1,10 @@ import base64 import itertools import os -import time from collections import defaultdict from datetime import datetime from pathlib import Path - -class Spinner: - def __init__(self, io, text): - self.io = io - self.text = text - print(f"{self.text} {next(self.io.spinner_chars)}", end="\r", flush=True) - - def step(self): - print(f"{self.text} {next(self.io.spinner_chars)}", end="\r", flush=True) - - def end(self): - print(f"{self.text} Done!") - - from prompt_toolkit.completion import Completer, Completion from prompt_toolkit.enums import EditingMode from prompt_toolkit.history import FileHistory @@ -37,6 +22,19 @@ 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 + print(f"{self.text} {next(self.io.spinner_chars)}", end="\r", flush=True) + + def step(self): + print(f"{self.text} {next(self.io.spinner_chars)}", end="\r", flush=True) + + def end(self): + print(f"{self.text} Done!") + + class AutoCompleter(Completer): def __init__(self, root, rel_fnames, addable_rel_fnames, commands, encoding): self.addable_rel_fnames = addable_rel_fnames