mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 12:45:00 +00:00
fix: Remove unused run_interactive_subprocess method from EditBlockCoder
This commit is contained in:
parent
15639d8801
commit
089863cf32
3 changed files with 2 additions and 21 deletions
|
@ -36,24 +36,6 @@ class EditBlockCoder(Coder):
|
||||||
|
|
||||||
return edits
|
return edits
|
||||||
|
|
||||||
def run_interactive_subprocess(self, command):
|
|
||||||
try:
|
|
||||||
result = subprocess.run(
|
|
||||||
command,
|
|
||||||
text=True,
|
|
||||||
shell=True,
|
|
||||||
encoding=self.io.encoding,
|
|
||||||
errors="replace",
|
|
||||||
)
|
|
||||||
if result.returncode == 0:
|
|
||||||
return
|
|
||||||
self.io.tool_error(f"Command '{command}' exited with status {result.returncode}")
|
|
||||||
except Exception as e:
|
|
||||||
self.io.tool_error(f"Error running command '{command}': {str(e)}")
|
|
||||||
|
|
||||||
self.io.tool_output(f"To retry and share output with the LLM: /run {command}")
|
|
||||||
self.io.tool_output("You can find this command in your input history with up-arrow.")
|
|
||||||
|
|
||||||
def apply_edits(self, edits):
|
def apply_edits(self, edits):
|
||||||
failed = []
|
failed = []
|
||||||
passed = []
|
passed = []
|
||||||
|
|
|
@ -16,7 +16,7 @@ IMAGE_EXTENSIONS = {".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".webp"}
|
||||||
|
|
||||||
def run_interactive_command(command):
|
def run_interactive_command(command):
|
||||||
try:
|
try:
|
||||||
import pexpect
|
import pexpect # noqa: F401
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return run_interactive_command_subprocess(command)
|
return run_interactive_command_subprocess(command)
|
||||||
|
|
||||||
|
@ -391,9 +391,7 @@ if __name__ == "__main__":
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
command = " ".join(sys.argv[1:])
|
command = " ".join(sys.argv[1:])
|
||||||
exit_status, output = run_interactive_command(command)
|
exit_status, output = run_interactive_command(command)
|
||||||
print("Exit status:")
|
|
||||||
dump(exit_status)
|
dump(exit_status)
|
||||||
print("\nFull output:")
|
|
||||||
dump(output)
|
dump(output)
|
||||||
else:
|
else:
|
||||||
print("Usage: python -m aider.utils <command>")
|
print("Usage: python -m aider.utils <command>")
|
||||||
|
|
|
@ -24,6 +24,7 @@ flake8
|
||||||
importlib_resources
|
importlib_resources
|
||||||
pyperclip
|
pyperclip
|
||||||
pypager
|
pypager
|
||||||
|
pexpect
|
||||||
|
|
||||||
# The proper depdendency is networkx[default], but this brings
|
# The proper depdendency is networkx[default], but this brings
|
||||||
# in matplotlib and a bunch of other deps
|
# in matplotlib and a bunch of other deps
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue