aider is AI pair programming in your terminal https://aider.chat/
Find a file
Paul Gauthier 6ba8b7d41e Switch get_input() to use prompt_toolkit for input`.
# Context:
USER: switch get_input() to use prompt_toolkit for input
ASSISTANT: To switch `get_input()` to use `prompt_toolkit` for input, you'll need to install the `prompt_toolkit` library and replace the current input method with the `prompt_toolkit`'s `prompt` function. Here's how to make the change:

1. Install `prompt_toolkit` by adding it to your project's requirements or running `pip install prompt_toolkit`.

2. Import `prompt` from `prompt_toolkit` at the beginning of the `coder.py` file.

3. Replace the current input method in the `get_input()` function with the `prompt` function from `prompt_toolkit`.

Here are the changes to the `coder.py` file:

```python
coder.py
<<<<<<< ORIGINAL
import sys
import re
import readline
import traceback
=======
import sys
import re
import traceback
from prompt_toolkit import prompt
>>>>>>> UPDATED
```

```python
coder.py
<<<<<<< ORIGINAL
while True:
    try:
        if multiline_input:
            line = input(". ")
        else:
            line = input("> ")
    except EOFError:
        return
=======
while True:
    try:
        if multiline_input:
            line = prompt(". ")
        else:
            line = prompt("> ")
    except EOFError:
        return
>>>>>>> UPDATED
```

These changes will replace the standard `input()` function with the `prompt_toolkit`'s `prompt` function in the `get_input()` method.
2023-05-09 09:03:45 -07:00
.flake8 debug 2023-05-08 22:55:55 -07:00
.pre-commit-config.yaml added flake8 2023-05-07 22:13:57 -07:00
coder.py Switch get_input() to use prompt_toolkit for input`. 2023-05-09 09:03:45 -07:00
dump.py init 2023-04-19 09:03:23 -07:00
main.py WIP: Refactor CLI help messages to use $ prefix for environment variables. 2023-05-09 00:38:10 -07:00
prompts.py prompts 2023-05-09 00:38:55 -07:00
test_utils.py Add tests for strip_quoted_wrapping function in test_utils.py. 2023-05-09 08:44:35 -07:00
utils.py added docstring to strip_quoted_wrapping 2023-05-09 07:42:05 -07:00