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 10 matching lines...) Expand all Loading... |
21 path = os.path.abspath(__file__) | 21 path = os.path.abspath(__file__) |
22 while True: | 22 while True: |
23 path, tail = os.path.split(path) | 23 path, tail = os.path.split(path) |
24 assert tail | 24 assert tail |
25 if tail == dirname: | 25 if tail == dirname: |
26 return path | 26 return path |
27 | 27 |
28 # Manually check for the command-line flag. (This isn't quite right, since it | 28 # Manually check for the command-line flag. (This isn't quite right, since it |
29 # ignores, e.g., "--", but it's close enough.) | 29 # ignores, e.g., "--", but it's close enough.) |
30 if "--use_bundled_pylibs" in sys.argv[1:]: | 30 if "--use_bundled_pylibs" in sys.argv[1:]: |
31 sys.path.insert(0, os.path.join(_GetDirAbove("public"), "public/third_party")) | 31 sys.path.insert(0, os.path.join(_GetDirAbove("mojo"), "third_party")) |
32 | 32 |
33 sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), | 33 sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), |
34 "pylib")) | 34 "pylib")) |
35 | 35 |
36 from mojom.error import Error | 36 from mojom.error import Error |
37 import mojom.fileutil as fileutil | 37 import mojom.fileutil as fileutil |
38 from mojom.generate.data import OrderedModuleFromData | 38 from mojom.generate.data import OrderedModuleFromData |
39 from mojom.parse.parser import Parse | 39 from mojom.parse.parser import Parse |
40 from mojom.parse.translate import Translate | 40 from mojom.parse.translate import Translate |
41 | 41 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 processor = MojomProcessor(lambda filename: filename in args.filename) | 204 processor = MojomProcessor(lambda filename: filename in args.filename) |
205 for filename in args.filename: | 205 for filename in args.filename: |
206 processor.ProcessFile(args, remaining_args, generator_modules, filename) | 206 processor.ProcessFile(args, remaining_args, generator_modules, filename) |
207 | 207 |
208 return 0 | 208 return 0 |
209 | 209 |
210 | 210 |
211 if __name__ == "__main__": | 211 if __name__ == "__main__": |
212 sys.exit(main()) | 212 sys.exit(main()) |
OLD | NEW |