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 import ast | |
7 import os | |
8 import sys | |
9 | |
10 script_dir = os.path.dirname(os.path.realpath(__file__)) | |
11 sys.path.insert(0, os.path.join(script_dir, os.pardir, "pylib")) | |
12 | |
13 from mojom.generate.data | |
14 import mojom_cpp_generator | |
15 | |
16 def ReadDict(file): | |
17 with open(file, 'r') as f: | |
18 s = f.read() | |
19 dict = ast.literal_eval(s) | |
20 return dict | |
21 | |
22 dict = ReadDict(sys.argv[1]) | |
23 module = mojom.generate.data.ModuleFromData(dict) | |
24 dir = None | |
25 if len(sys.argv) > 2: | |
26 dir = sys.argv[2] | |
27 cpp = mojom_cpp_generator.Generator(module, ".", dir) | |
28 cpp.GenerateFiles([]) | |
OLD | NEW |