mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-05 20:25:01 +00:00
fix: Move Spinner class to top level and remove elapsed time display
This commit is contained in:
parent
17f1f2862d
commit
44f3ed6433
1 changed files with 13 additions and 15 deletions
28
aider/io.py
28
aider/io.py
|
@ -1,25 +1,10 @@
|
||||||
import base64
|
import base64
|
||||||
import itertools
|
import itertools
|
||||||
import os
|
import os
|
||||||
import time
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
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.completion import Completer, Completion
|
||||||
from prompt_toolkit.enums import EditingMode
|
from prompt_toolkit.enums import EditingMode
|
||||||
from prompt_toolkit.history import FileHistory
|
from prompt_toolkit.history import FileHistory
|
||||||
|
@ -37,6 +22,19 @@ from .dump import dump # noqa: F401
|
||||||
from .utils import is_image_file
|
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):
|
class AutoCompleter(Completer):
|
||||||
def __init__(self, root, rel_fnames, addable_rel_fnames, commands, encoding):
|
def __init__(self, root, rel_fnames, addable_rel_fnames, commands, encoding):
|
||||||
self.addable_rel_fnames = addable_rel_fnames
|
self.addable_rel_fnames = addable_rel_fnames
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue