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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 9309044: Supporting more APIs with json_schema_compiler (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rework, updated base Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: tools/json_schema_compiler/compiler.py
diff --git a/tools/json_schema_compiler/compiler.py b/tools/json_schema_compiler/compiler.py
index afd499dce29fe816baa9347fbae2bd25c63e18d9..fab0504d56daebd9015479b94e4d89adb7a75435 100644
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -73,23 +73,27 @@ if __name__ == '__main__':
if not namespace:
continue
- out_file = cpp_util.CppName(namespace.name).lower() + filename_suffix
+ out_file = namespace.name + filename_suffix
type_generator = cpp_type_generator.CppTypeGenerator(root_namespace,
namespace, out_file)
for referenced_namespace in api_model.namespaces.values():
- type_generator.AddNamespace(referenced_namespace,
- cpp_util.CppName(referenced_namespace.name).lower() + filename_suffix)
+ type_generator.AddNamespace(
+ referenced_namespace,
+ cpp_util.Classname(referenced_namespace.name).lower() +
+ filename_suffix)
cc_generator = cc_generator.CCGenerator(namespace, type_generator)
cc_code = cc_generator.Generate().Render()
h_generator = h_generator.HGenerator(namespace, type_generator)
h_code = h_generator.Generate().Render()
if dest_dir:
- with open(os.path.join(dest_dir, namespace.source_file_dir,
- out_file + '.cc'), 'w') as cc_file:
+ with open(
+ os.path.join(dest_dir, namespace.source_file_dir, out_file + '.cc'),
+ 'w') as cc_file:
cc_file.write(cc_code)
- with open(os.path.join(dest_dir, namespace.source_file_dir,
- out_file + '.h'), 'w') as h_file:
+ with open(
+ os.path.join(dest_dir, namespace.source_file_dir, out_file + '.h'),
+ 'w') as h_file:
h_file.write(h_code)
else:
print '%s.h' % out_file

Powered by Google App Engine
This is Rietveld 408576698