mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
plumbed through to /web
This commit is contained in:
parent
5b78d929a6
commit
e42005a78e
1 changed files with 9 additions and 4 deletions
|
@ -7,14 +7,15 @@ import git
|
||||||
from prompt_toolkit.completion import Completion
|
from prompt_toolkit.completion import Completion
|
||||||
|
|
||||||
from aider import prompts, voice
|
from aider import prompts, voice
|
||||||
from aider.utils import is_gpt4_with_openai_base_url, is_image_file, scrape
|
from aider.scrape import Scraper
|
||||||
|
from aider.utils import is_gpt4_with_openai_base_url, is_image_file
|
||||||
|
|
||||||
from .dump import dump # noqa: F401
|
from .dump import dump # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
class Commands:
|
class Commands:
|
||||||
voice = None
|
voice = None
|
||||||
web_driver = None
|
scraper = None
|
||||||
|
|
||||||
def __init__(self, io, coder, voice_language=None):
|
def __init__(self, io, coder, voice_language=None):
|
||||||
self.io = io
|
self.io = io
|
||||||
|
@ -33,8 +34,12 @@ class Commands:
|
||||||
self.io.tool_error("Please provide a URL to scrape.")
|
self.io.tool_error("Please provide a URL to scrape.")
|
||||||
return
|
return
|
||||||
|
|
||||||
content = scrape(url)
|
if not self.scraper:
|
||||||
print(content)
|
self.scraper = Scraper(print_error=self.io.tool_error)
|
||||||
|
|
||||||
|
content = self.scraper.scrape(url)
|
||||||
|
self.io.tool_output(content)
|
||||||
|
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def is_command(self, inp):
|
def is_command(self, inp):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue