Skip to content

Commit a27fcf7

Browse files
committed
#335, #339: cmd_web no longer exists, update to use do_run()
1 parent ae16e5b commit a27fcf7

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

aider/coders/base_coder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ async def check_for_urls(self, inp: str) -> List[str]:
16521652
"Add URL to the chat?", subject=url, group=group, allow_never=True
16531653
):
16541654
inp += "\n\n"
1655-
inp += await self.commands.cmd_web(url, return_content=True)
1655+
inp += await self.commands.do_run("web", url, return_content=True)
16561656
else:
16571657
self.rejected_urls.add(url)
16581658

aider/commands.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def get_commands(self):
105105
commands = [f"/{cmd}" for cmd in registry_commands]
106106
return sorted(commands)
107107

108-
async def do_run(self, cmd_name, args):
108+
async def do_run(self, cmd_name, args, **kwargs):
109109
# Execute command using registry
110110
command_class = CommandRegistry.get_command(cmd_name)
111111
if not command_class:
@@ -115,17 +115,19 @@ async def do_run(self, cmd_name, args):
115115
self.cmd_running_event.clear() # Command is running
116116
try:
117117
# Generate a spreadable kwargs dict with all relevant Commands attributes
118-
kwargs = {
119-
"original_read_only_fnames": self.original_read_only_fnames,
120-
"voice_language": self.voice_language,
121-
"voice_format": self.voice_format,
122-
"voice_input_device": self.voice_input_device,
123-
"verify_ssl": self.verify_ssl,
124-
"parser": self.parser,
125-
"verbose": self.verbose,
126-
"editor": self.editor,
127-
"system_args": self.args,
128-
}
118+
kwargs.update(
119+
{
120+
"original_read_only_fnames": self.original_read_only_fnames,
121+
"voice_language": self.voice_language,
122+
"voice_format": self.voice_format,
123+
"voice_input_device": self.voice_input_device,
124+
"verify_ssl": self.verify_ssl,
125+
"parser": self.parser,
126+
"verbose": self.verbose,
127+
"editor": self.editor,
128+
"system_args": self.args,
129+
}
130+
)
129131

130132
return await CommandRegistry.execute(
131133
cmd_name,

tests/scrape/test_scrape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def mock_install(*args, **kwargs):
5858

5959
try:
6060
# Run the cmd_web command
61-
result = await self.commands.cmd_web("https://example.com", return_content=True)
61+
result = await self.commands.do_run("web", "https://example.com", return_content=True)
6262

6363
# Assert that the result contains some content
6464
self.assertIsNotNone(result)

0 commit comments

Comments
 (0)