mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
style: Format code with consistent quotes and spacing
This commit is contained in:
parent
520eb4a932
commit
2d8bc95bae
1 changed files with 11 additions and 11 deletions
|
@ -14,46 +14,46 @@ def main():
|
||||||
|
|
||||||
input_file = sys.argv[1]
|
input_file = sys.argv[1]
|
||||||
output_file = sys.argv[2]
|
output_file = sys.argv[2]
|
||||||
|
|
||||||
# Count total lines for progress bar
|
# Count total lines for progress bar
|
||||||
total_lines = sum(1 for _ in open(input_file, 'r'))
|
total_lines = sum(1 for _ in open(input_file, "r"))
|
||||||
|
|
||||||
with open(input_file, "r") as fin, open(output_file, "w") as fout:
|
with open(input_file, "r") as fin, open(output_file, "w") as fout:
|
||||||
# Process header
|
# Process header
|
||||||
header = fin.readline().strip()
|
header = fin.readline().strip()
|
||||||
fout.write(header + "\n")
|
fout.write(header + "\n")
|
||||||
|
|
||||||
# Parse header for terminal dimensions
|
# Parse header for terminal dimensions
|
||||||
header_data = json.loads(header)
|
header_data = json.loads(header)
|
||||||
width = header_data.get("width", 80)
|
width = header_data.get("width", 80)
|
||||||
height = header_data.get("height", 24)
|
height = header_data.get("height", 24)
|
||||||
print(f"Terminal dimensions: {width}x{height}")
|
print(f"Terminal dimensions: {width}x{height}")
|
||||||
|
|
||||||
# Initialize terminal emulator
|
# Initialize terminal emulator
|
||||||
screen = pyte.Screen(width, height)
|
screen = pyte.Screen(width, height)
|
||||||
stream = pyte.Stream(screen)
|
stream = pyte.Stream(screen)
|
||||||
|
|
||||||
# Process events line by line
|
# Process events line by line
|
||||||
for line in tqdm(fin, desc="Processing events", total=total_lines-1):
|
for line in tqdm(fin, desc="Processing events", total=total_lines - 1):
|
||||||
if not line.strip():
|
if not line.strip():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
event = json.loads(line)
|
event = json.loads(line)
|
||||||
|
|
||||||
# Only run terminal emulation for output events
|
# Only run terminal emulation for output events
|
||||||
if len(event) >= 3 and event[1] == "o":
|
if len(event) >= 3 and event[1] == "o":
|
||||||
stream.feed(event[2])
|
stream.feed(event[2])
|
||||||
|
|
||||||
# Check if "Atuin" is visible on screen - exit early if found
|
# Check if "Atuin" is visible on screen - exit early if found
|
||||||
atuin_visible = False
|
atuin_visible = False
|
||||||
for display_line in screen.display:
|
for display_line in screen.display:
|
||||||
if "Atuin" in display_line:
|
if "Atuin" in display_line:
|
||||||
atuin_visible = True
|
atuin_visible = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if atuin_visible:
|
if atuin_visible:
|
||||||
continue # Skip this event
|
continue # Skip this event
|
||||||
|
|
||||||
# Write event to output file
|
# Write event to output file
|
||||||
fout.write(json.dumps(event) + "\n")
|
fout.write(json.dumps(event) + "\n")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue