OLD | NEW |
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 # | 4 # |
5 # This python script creates a version string in a C++ file. | 5 # This python script creates a version string in a C++ file. |
6 | 6 |
7 import sys | 7 import sys |
8 import time | 8 import time |
9 from optparse import OptionParser | 9 from optparse import OptionParser |
10 import utils | 10 import utils |
11 | 11 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 help="input template file") | 43 help="input template file") |
44 | 44 |
45 (options, args) = parser.parse_args() | 45 (options, args) = parser.parse_args() |
46 if not options.output: | 46 if not options.output: |
47 sys.stderr.write('--output not specified\n') | 47 sys.stderr.write('--output not specified\n') |
48 return -1 | 48 return -1 |
49 if not len(options.input): | 49 if not len(options.input): |
50 sys.stderr.write('--input not specified\n') | 50 sys.stderr.write('--input not specified\n') |
51 return -1 | 51 return -1 |
52 | 52 |
53 files = [ ] | 53 files = [] |
54 for arg in args: | 54 for arg in args: |
55 files.append(arg) | 55 files.append(arg) |
56 | 56 |
57 if not makeFile(options.output, options.input): | 57 if not makeFile(options.output, options.input): |
58 return -1 | 58 return -1 |
59 | 59 |
60 return 0 | 60 return 0 |
61 except Exception, inst: | 61 except Exception, inst: |
62 sys.stderr.write('make_version.py exception\n') | 62 sys.stderr.write('make_version.py exception\n') |
63 sys.stderr.write(str(inst)) | 63 sys.stderr.write(str(inst)) |
64 sys.stderr.write('\n') | 64 sys.stderr.write('\n') |
65 return -1 | 65 return -1 |
66 | 66 |
67 if __name__ == '__main__': | 67 if __name__ == '__main__': |
68 exit_code = main(sys.argv) | 68 exit_code = main(sys.argv) |
69 sys.exit(exit_code) | 69 sys.exit(exit_code) |
OLD | NEW |