| OLD | NEW |
| 1 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2013, 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 string literals in a C++ source file from a C++ | 5 # This python script creates string literals in a C++ source file from a C++ |
| 6 # source template and one or more resource files. | 6 # source template and one or more resource files. |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 from os.path import join | 10 from os.path import join |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 if options.client_root != None: | 121 if options.client_root != None: |
| 122 for dirname, dirnames, filenames in os.walk(options.client_root): | 122 for dirname, dirnames, filenames in os.walk(options.client_root): |
| 123 # strip out all dot files. | 123 # strip out all dot files. |
| 124 filenames = [f for f in filenames if not f[0] == '.'] | 124 filenames = [f for f in filenames if not f[0] == '.'] |
| 125 dirnames[:] = [d for d in dirnames if not d[0] == '.'] | 125 dirnames[:] = [d for d in dirnames if not d[0] == '.'] |
| 126 for f in filenames: | 126 for f in filenames: |
| 127 src_path = os.path.join(dirname, f) | 127 src_path = os.path.join(dirname, f) |
| 128 if (os.path.isdir(src_path)): | 128 if (os.path.isdir(src_path)): |
| 129 continue | 129 continue |
| 130 # Skip devtools version |
| 131 if (src_path.find("index_devtools") != -1): |
| 132 continue |
| 130 files.append(src_path) | 133 files.append(src_path) |
| 131 | 134 |
| 132 for arg in args: | 135 for arg in args: |
| 133 files.append(arg) | 136 files.append(arg) |
| 134 | 137 |
| 135 if not makeFile(options.output, options.root_prefix, files, | 138 if not makeFile(options.output, options.root_prefix, files, |
| 136 options.outer_namespace, options.inner_namespace, | 139 options.outer_namespace, options.inner_namespace, |
| 137 options.table_name): | 140 options.table_name): |
| 138 return -1 | 141 return -1 |
| 139 | 142 |
| 140 return 0 | 143 return 0 |
| 141 except Exception, inst: | 144 except Exception, inst: |
| 142 sys.stderr.write('create_resources.py exception\n') | 145 sys.stderr.write('create_resources.py exception\n') |
| 143 sys.stderr.write(str(inst)) | 146 sys.stderr.write(str(inst)) |
| 144 sys.stderr.write('\n') | 147 sys.stderr.write('\n') |
| 145 return -1 | 148 return -1 |
| 146 | 149 |
| 147 if __name__ == '__main__': | 150 if __name__ == '__main__': |
| 148 sys.exit(main(sys.argv)) | 151 sys.exit(main(sys.argv)) |
| OLD | NEW |