aider: Replaced all self.console.print() calls with self.io.tool_error() calls.

# Context:
USER: replace all the self.console.print() calls that contain [red] with calls to self.io.tool_error() with [red] removed from the string
ASSISTANT: aider/coder.py
<<<<<<< ORIGINAL
            self.console.print("[red]^C again to quit")
=======
            self.io.tool_error("^C again to quit")
>>>>>>> UPDATED

aider/coder.py
<<<<<<< ORIGINAL
            self.io.tool_error("Malformed ORIGINAL/UPDATE blocks, retrying...")
            self.io.tool_error(err)
=======
            self.io.tool_error("Malformed ORIGINAL/UPDATE blocks, retrying...")
            self.io.tool_error(str(err))
>>>>>>> UPDATED

aider/coder.py
<<<<<<< ORIGINAL
            self.console.print("[red]Unable to get commit message from gpt-3.5-turbo. Use /commit to try again.\n")
=======
            self.io.tool_error("Unable to get commit message from gpt-3.5-turbo. Use /commit to try again.")
>>>>>>> UPDATED

aider/coder.py
<<<<<<< ORIGINAL
            self.console.print("[red]Skipped commmit.")
=======
            self.io.tool_error("Skipped commmit.")
>>>>>>> UPDATED
This commit is contained in:
Paul Gauthier 2023-05-12 13:31:32 -07:00
parent 92e091f5a6
commit fca8ea3c21

View file

@ -180,7 +180,7 @@ class Coder:
self.num_control_c += 1 self.num_control_c += 1
if self.num_control_c >= 2: if self.num_control_c >= 2:
break break
self.console.print("[red]^C again to quit") self.io.tool_error("^C again to quit")
except EOFError: except EOFError:
return return
@ -259,7 +259,7 @@ class Coder:
except ValueError as err: except ValueError as err:
err = err.args[0] err = err.args[0]
self.io.tool_error("Malformed ORIGINAL/UPDATE blocks, retrying...") self.io.tool_error("Malformed ORIGINAL/UPDATE blocks, retrying...")
self.io.tool_error(err) self.io.tool_error(str(err))
return err return err
except Exception as err: except Exception as err:
@ -446,7 +446,7 @@ class Coder:
if interrupted: if interrupted:
self.console.print( self.console.print(
"[red]Unable to get commit message from gpt-3.5-turbo. Use /commit to try again.\n" self.io.tool_error("Unable to get commit message from gpt-3.5-turbo. Use /commit to try again.")
) )
return return
@ -521,7 +521,7 @@ class Coder:
self.console.print() self.console.print()
if res.lower() in ["n", "no"]: if res.lower() in ["n", "no"]:
self.console.print("[red]Skipped commmit.") self.io.tool_error("Skipped commmit.")
return return
if res.lower() not in ["y", "yes"] and res: if res.lower() not in ["y", "yes"] and res:
commit_message = res commit_message = res