MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / show_patch

Function show_patch

core/display.py:75–84  ·  view source on GitHub ↗

Show a patch operation as a mini diff.

(path, old_str, new_str)

Source from the content-addressed store, hash-verified

73 border_style='green', box=box.ROUNDED))
74
75def show_patch(path, old_str, new_str):
76 """Show a patch operation as a mini diff."""
77 fname = Path(path).name
78 diff_text = Text()
79 for line in old_str.splitlines():
80 diff_text.append(f'- {line}\n', style='red')
81 for line in new_str.splitlines():
82 diff_text.append(f'+ {line}\n', style='green')
83 console.print(Panel(diff_text, title=f'Patching {fname}',
84 border_style='yellow', box=box.ROUNDED))
85
86def show_shell(command, output, error=False):
87 """Show shell command and its output."""

Callers 1

execute_toolFunction · 0.90

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected