(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS)
| 416 | # end def delete_file |
| 417 | |
| 418 | def reformat_file(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS): |
| 419 | with open(filename, 'r') as f: |
| 420 | source = f.read() |
| 421 | # end with |
| 422 | result = reformat_string(source, stepsize, tabsize, expandtabs) |
| 423 | if source == result: return 0 |
| 424 | # end if |
| 425 | make_backup(filename) |
| 426 | with open(filename, 'w') as f: |
| 427 | f.write(result) |
| 428 | # end with |
| 429 | return 1 |
| 430 | # end def reformat_file |
| 431 | |
| 432 | # Test program when called as a script |
nothing calls this directly
no test coverage detected