From 4763582c9e0402ba85c03410ac5505c9e85ad794 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 22 Aug 2024 06:34:22 -0700 Subject: [PATCH] style: Format Python code --- testsr.py | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/testsr.py b/testsr.py index 62af795ed..ea931765b 100644 --- a/testsr.py +++ b/testsr.py @@ -1,7 +1,9 @@ +import json import re import sys -import json -from aider.coders.editblock_coder import find_original_update_blocks, DEFAULT_FENCE + +from aider.coders.editblock_coder import DEFAULT_FENCE, find_original_update_blocks + def process_markdown(filename): try: @@ -23,24 +25,20 @@ def process_markdown(filename): blocks = list(find_original_update_blocks(content, DEFAULT_FENCE)) # Create a dictionary for this section - section_result = { - "header": header, - "blocks": [] - } + section_result = {"header": header, "blocks": []} for block in blocks: if block[0] is None: # This is a shell command block - section_result["blocks"].append({ - "type": "shell", - "content": block[1] - }) + section_result["blocks"].append({"type": "shell", "content": block[1]}) else: # This is a SEARCH/REPLACE block - section_result["blocks"].append({ - "type": "search_replace", - "filename": block[0], - "original": block[1], - "updated": block[2] - }) + section_result["blocks"].append( + { + "type": "search_replace", + "filename": block[0], + "original": block[1], + "updated": block[2], + } + ) results.append(section_result) @@ -52,6 +50,7 @@ def process_markdown(filename): except Exception as e: print(json.dumps({"error": f"An error occurred: {str(e)}"})) + if __name__ == "__main__": if len(sys.argv) != 2: print(json.dumps({"error": "Usage: python testsr.py "}))