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

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

Issue 226263002: Mojo: Move mojo/public/bindings to mojo/public/tools/bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 8 months 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 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 import ast 6 import ast
7 import os 7 import os
8 import sys 8 import sys
9 9
10 script_dir = os.path.dirname(os.path.realpath(__file__)) 10 script_dir = os.path.dirname(os.path.realpath(__file__))
11 sys.path.insert(0, os.path.join(script_dir, os.pardir, "pylib")) 11 sys.path.insert(0, os.path.join(script_dir, os.pardir, "pylib"))
12 12
13 from generate import mojom_data 13 from generate import mojom_data
14 import mojom_cpp_generator 14 import mojom_cpp_generator
15 15
16 def ReadDict(file): 16 def ReadDict(file):
17 with open(file, 'r') as f: 17 with open(file, 'r') as f:
18 s = f.read() 18 s = f.read()
19 dict = ast.literal_eval(s) 19 dict = ast.literal_eval(s)
20 return dict 20 return dict
21 21
22 dict = ReadDict(sys.argv[1]) 22 dict = ReadDict(sys.argv[1])
23 module = mojom_data.ModuleFromData(dict) 23 module = mojom_data.ModuleFromData(dict)
24 dir = None 24 dir = None
25 if len(sys.argv) > 2: 25 if len(sys.argv) > 2:
26 dir = sys.argv[2] 26 dir = sys.argv[2]
27 cpp = mojom_cpp_generator.Generator(module, ".", dir) 27 cpp = mojom_cpp_generator.Generator(module, ".", dir)
28 cpp.GenerateFiles() 28 cpp.GenerateFiles()
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_js_generator.py ('k') | mojo/public/tools/bindings/mojom_bindings_generator.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698