Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: mojo/public/bindings/generators/run_cpp_generator.py

Issue 52973003: mojo: break struct headers into headers and source (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add constant for header size Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 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 import ast 6 import ast
7 import mojom 7 import mojom
8 import mojom_cpp_generator 8 import mojom_cpp_generator
9 import mojom_data 9 import mojom_data
10 import mojom_pack 10 import mojom_pack
11 import sys 11 import sys
12 12
13 def ReadDict(file): 13 def ReadDict(file):
14 with open(file, 'r') as f: 14 with open(file, 'r') as f:
15 s = f.read() 15 s = f.read()
16 dict = ast.literal_eval(s) 16 dict = ast.literal_eval(s)
17 return dict 17 return dict
18 18
19 dict = ReadDict(sys.argv[1]) 19 dict = ReadDict(sys.argv[1])
20 module = mojom_data.ModuleFromData(dict) 20 module = mojom_data.ModuleFromData(dict)
21 cpp = mojom_cpp_generator.CPPGenerator(module)
22 dir = None 21 dir = None
23 if len(sys.argv) > 2: 22 if len(sys.argv) > 2:
24 dir = sys.argv[2] 23 dir = sys.argv[2]
25 cpp.GenerateFiles(dir) 24 cpp = mojom_cpp_generator.CPPGenerator(module, "src", dir)
25 cpp.GenerateFiles()
OLDNEW
« no previous file with comments | « mojo/public/bindings/generators/mojom_cpp_generator.py ('k') | mojo/public/bindings/mojo_idl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698