mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
fix: Update error message formatting in process_markdown function
This commit is contained in:
parent
882cf676b9
commit
695e8c384c
1 changed files with 8 additions and 8 deletions
16
testsr.py
16
testsr.py
|
@ -27,7 +27,7 @@ def process_markdown(filename):
|
|||
with open(filename, "r") as file:
|
||||
content = file.read()
|
||||
except FileNotFoundError:
|
||||
print(f"*** File '{filename}' not found.", "*" * 20)
|
||||
print(f"@@@ File '{filename}' not found.", "@" * 20)
|
||||
return
|
||||
|
||||
# Split the content into sections based on '####' headers
|
||||
|
@ -52,25 +52,25 @@ def process_markdown(filename):
|
|||
try:
|
||||
blocks = list(find_original_update_blocks(content, fence))
|
||||
except ValueError as e:
|
||||
print("***", header, "*" * 20)
|
||||
print("\n\n@@@", header, "@" * 20)
|
||||
print(str(e))
|
||||
continue
|
||||
|
||||
if blocks:
|
||||
print("***", header, "*" * 20)
|
||||
print("\n\n@@@", header, "@" * 20)
|
||||
|
||||
for block in blocks:
|
||||
if block[0] is None: # This is a shell command block
|
||||
print("*** SHELL", "*" * 20)
|
||||
print("@@@ SHELL", "@" * 20)
|
||||
print(block[1], end="")
|
||||
print("*** ENDSHELL", "*" * 20)
|
||||
print("@@@ ENDSHELL", "@" * 20)
|
||||
|
||||
else: # This is a SEARCH/REPLACE block
|
||||
print("*** SEARCH:", block[0], "*" * 20)
|
||||
print("@@@ SEARCH:", block[0], "@" * 20)
|
||||
print(block[1], end="")
|
||||
print("*" * 20)
|
||||
print("@" * 20)
|
||||
print(block[2], end="")
|
||||
print("*** REPLACE", "*" * 20)
|
||||
print("@@@ REPLACE", "@" * 20)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue