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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 2601333002: Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: Better solution Created 3 years, 12 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 257a0de96b3c0655b5a727e856d41f0f49594792..3a63d204f78fa2f03817cb4f921f44731c62adc6 100755
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -45,7 +45,8 @@ def GenerateSchema(generator_name,
cpp_namespace_pattern,
bundle_name,
impl_dir,
- include_rules):
+ include_rules,
+ no_normalize_enums):
# Merge the source files into a single list of schemas.
api_defs = []
for file_path in file_paths:
@@ -126,7 +127,8 @@ def GenerateSchema(generator_name,
]
elif generator_name == 'externs':
generators = [
- ('%s_externs.js' % namespace.unix_name, JsExternsGenerator())
+ ('%s_externs.js' % namespace.unix_name, JsExternsGenerator(
+ no_normalize_enums))
]
elif generator_name == 'interface':
generators = [
@@ -183,6 +185,10 @@ if __name__ == '__main__':
help='A list of paths to include when searching for referenced objects,'
' with the namespace separated by a \':\'. Example: '
'/foo/bar:Foo::Bar::%(namespace)s')
+ parser.add_option('-e', '--no-normalize-enums', action='store_true',
+ dest='no_normalize_enums',
Devlin 2017/01/04 23:54:21 nit: no_normalize_enums sounds funny - maybe we co
+ help='Do not normalize enums to uppercase with underscores'
+ ' when generating externs')
(opts, file_paths) = parser.parse_args()
@@ -209,6 +215,6 @@ if __name__ == '__main__':
result = GenerateSchema(opts.generator, file_paths, opts.root, opts.destdir,
opts.namespace, opts.bundle_name, opts.impl_dir,
- include_rules)
+ include_rules, opts.no_normalize_enums)
if not opts.destdir:
print result

Powered by Google App Engine
This is Rietveld 408576698