Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/env python | |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """ | |
| 7 remove_file.py -- Remove the specified directory or file | |
| 8 """ | |
| 9 | |
| 10 import os | |
| 11 import sys | |
| 12 | |
| 13 sys.path.append(os.path.join(os.path.dirname(__file__), 'lib', 'common')) | |
|
Isaac (away)
2013/08/26 23:17:39
Why not use shutil?
hajimehoshi
2013/08/27 03:40:50
Done.
| |
| 14 import util | |
| 15 | |
| 16 def main(argv=None): | |
| 17 if argv is None: | |
| 18 argv = sys.argv | |
| 19 | |
| 20 if len(argv) != 2: | |
| 21 program = os.path.basename(__file__) | |
| 22 sys.stderr.write('Usage: ' + program + ' PATH\n') | |
| 23 sys.exit(1) | |
| 24 | |
| 25 path = argv[1] | |
| 26 util.MaybeDelete(path) | |
| 27 | |
| 28 if __name__ == '__main__': | |
| 29 sys.exit(main()) | |
| OLD | NEW |