MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / delete_file

Function delete_file

tools/python-3.11.9-amd64/Tools/scripts/pindent.py:404–415  ·  view source on GitHub ↗
(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS)

Source from the content-addressed store, hash-verified

402# end def complete_file
403
404def delete_file(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):
405 with open(filename, 'r') as f:
406 source = f.read()
407 # end with
408 result = delete_string(source, stepsize, tabsize, expandtabs)
409 if source == result: return 0
410 # end if
411 make_backup(filename)
412 with open(filename, 'w') as f:
413 f.write(result)
414 # end with
415 return 1
416# end def delete_file
417
418def reformat_file(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):

Callers

nothing calls this directly

Calls 5

delete_stringFunction · 0.85
make_backupFunction · 0.85
openFunction · 0.50
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected