MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / run_operation

Function run_operation

tools/sync_test_files.py:32–46  ·  view source on GitHub ↗
(
    name: str, source: str, dest: str, cmd: code_writer_cmd
)

Source from the content-addressed store, hash-verified

30
31
32def run_operation(
33 name: str, source: str, dest: str, cmd: code_writer_cmd
34) -> None:
35 source_data = Path(source).read_text().replace(remove_str, "")
36 dest_data = header.format(source=source, this_file=this_file) + source_data
37
38 with NamedTemporaryFile(
39 mode="w",
40 delete=False,
41 suffix=".py",
42 ) as buf:
43 buf.write(dest_data)
44
45 cmd.run_black(buf.name)
46 cmd.write_output_file_from_tempfile(buf.name, dest)
47
48
49def main(file: str, cmd: code_writer_cmd) -> None:

Callers 1

mainFunction · 0.85

Calls 4

run_blackMethod · 0.80
replaceMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected