MCPcopy Create free account
hub / github.com/numpy/numpy / process_and_write_file

Function process_and_write_file

numpy/_build_utils/process_src_template.py:23–34  ·  view source on GitHub ↗

Process tempita templated file and write out the result. The template file is expected to end in `.src` (e.g., `.c.src` or `.h.src`). Processing `npy_somefile.c.src` generates `npy_somefile.c`.

(fromfile, outfile)

Source from the content-addressed store, hash-verified

21
22
23def process_and_write_file(fromfile, outfile):
24 """Process tempita templated file and write out the result.
25
26 The template file is expected to end in `.src`
27 (e.g., `.c.src` or `.h.src`).
28 Processing `npy_somefile.c.src` generates `npy_somefile.c`.
29
30 """
31 process_file = get_processor()
32 content = process_file(fromfile)
33 with open(outfile, 'w') as f:
34 f.write(content)
35
36
37def main():

Callers 1

mainFunction · 0.85

Calls 4

openFunction · 0.85
get_processorFunction · 0.70
process_fileFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected