mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
style: Move imports to top of file to fix E402 errors
This commit is contained in:
parent
a218b1d3d0
commit
4ad7df746e
1 changed files with 17 additions and 19 deletions
36
aider/io.py
36
aider/io.py
|
@ -10,24 +10,6 @@ from datetime import datetime
|
|||
from io import StringIO
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def restore_multiline(func):
|
||||
"""Decorator to restore multiline mode after function execution"""
|
||||
|
||||
@functools.wraps(func)
|
||||
def wrapper(self, *args, **kwargs):
|
||||
orig_multiline = self.multiline_mode
|
||||
self.multiline_mode = False
|
||||
try:
|
||||
return func(self, *args, **kwargs)
|
||||
except Exception:
|
||||
raise
|
||||
finally:
|
||||
self.multiline_mode = orig_multiline
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
from prompt_toolkit.completion import Completer, Completion, ThreadedCompleter
|
||||
from prompt_toolkit.cursor_shapes import ModalCursorShapeConfig
|
||||
from prompt_toolkit.enums import EditingMode
|
||||
|
@ -48,11 +30,27 @@ from rich.style import Style as RichStyle
|
|||
from rich.text import Text
|
||||
|
||||
from aider.mdstream import MarkdownStream
|
||||
|
||||
from .dump import dump # noqa: F401
|
||||
from .utils import is_image_file
|
||||
|
||||
|
||||
def restore_multiline(func):
|
||||
"""Decorator to restore multiline mode after function execution"""
|
||||
|
||||
@functools.wraps(func)
|
||||
def wrapper(self, *args, **kwargs):
|
||||
orig_multiline = self.multiline_mode
|
||||
self.multiline_mode = False
|
||||
try:
|
||||
return func(self, *args, **kwargs)
|
||||
except Exception:
|
||||
raise
|
||||
finally:
|
||||
self.multiline_mode = orig_multiline
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
@dataclass
|
||||
class ConfirmGroup:
|
||||
preference: str = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue