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

Function main

numpy/distutils/conv_template.py:308–326  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

306
307
308def main():
309 try:
310 file = sys.argv[1]
311 except IndexError:
312 fid = sys.stdin
313 outfile = sys.stdout
314 else:
315 fid = open(file, 'r')
316 (base, ext) = os.path.splitext(file)
317 newname = base
318 outfile = open(newname, 'w')
319
320 allstr = fid.read()
321 try:
322 writestr = process_str(allstr)
323 except ValueError as e:
324 raise ValueError("In %s loop at %s" % (file, e)) from None
325
326 outfile.write(writestr)
327
328if __name__ == "__main__":
329 main()

Callers 1

conv_template.pyFile · 0.70

Calls 4

openFunction · 0.85
process_strFunction · 0.70
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected