Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """The frontend for the Mojo bindings system.""" | 6 """The frontend for the Mojo bindings system.""" |
| 7 | 7 |
| 8 | 8 |
| 9 import argparse | 9 import argparse |
| 10 import imp | 10 import imp |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 help="comma-separated list of generators") | 199 help="comma-separated list of generators") |
| 200 parser.add_argument("--debug_print_intermediate", action="store_true", | 200 parser.add_argument("--debug_print_intermediate", action="store_true", |
| 201 help="print the intermediate representation") | 201 help="print the intermediate representation") |
| 202 parser.add_argument("-I", dest="import_directories", action="append", | 202 parser.add_argument("-I", dest="import_directories", action="append", |
| 203 metavar="directory", default=[], | 203 metavar="directory", default=[], |
| 204 help="add a directory to be searched for import files") | 204 help="add a directory to be searched for import files") |
| 205 parser.add_argument("--use_bundled_pylibs", action="store_true", | 205 parser.add_argument("--use_bundled_pylibs", action="store_true", |
| 206 help="use Python modules bundled in the SDK") | 206 help="use Python modules bundled in the SDK") |
| 207 (args, remaining_args) = parser.parse_known_args(argv) | 207 (args, remaining_args) = parser.parse_known_args(argv) |
| 208 | 208 |
| 209 # These flags are added to ensure that tests requiring type information pass. | |
| 210 # TODO(afandria): The caller of this script should be the one passing these | |
| 211 # flags in. https://github.com/domokit/mojo/issues/558 | |
|
rudominer
2015/12/14 21:29:57
The caller of this script is mojom_bindings_genera
| |
| 212 remaining_args.append("--go_gen_types") | |
| 213 | |
| 209 generator_modules = LoadGenerators(args.generators_string) | 214 generator_modules = LoadGenerators(args.generators_string) |
| 210 | 215 |
| 211 fileutil.EnsureDirectoryExists(args.output_dir) | 216 fileutil.EnsureDirectoryExists(args.output_dir) |
| 212 | 217 |
| 213 processor = MojomProcessor(lambda filename: filename in args.filename) | 218 processor = MojomProcessor(lambda filename: filename in args.filename) |
| 214 for filename in args.filename: | 219 for filename in args.filename: |
| 215 processor.ProcessFile(args, remaining_args, generator_modules, filename) | 220 processor.ProcessFile(args, remaining_args, generator_modules, filename) |
| 216 | 221 |
| 217 return 0 | 222 return 0 |
| 218 | 223 |
| 219 | 224 |
| 220 if __name__ == "__main__": | 225 if __name__ == "__main__": |
| 221 sys.exit(main(sys.argv[1:])) | 226 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |