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

Unified Diff: tools/json_schema_compiler/model.py

Issue 10108005: Make json_schema_compiler remove 'nocompile' nodes from JSON at the JSON level (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yoz Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/json_schema_compiler/json_schema_test.py ('k') | tools/json_schema_compiler/model_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/model.py
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index 53b3aee124c0d60736afabd9dd0bde3656c76759..9a5c55f07b54f56797e01cc763ef6715a0450a70 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -16,12 +16,8 @@ class Model(object):
self.namespaces = {}
def AddNamespace(self, json, source_file):
- """Add a namespace's json to the model if it doesn't have "nocompile"
- property set to true. Returns the new namespace or None if a namespace
- wasn't added.
+ """Add a namespace's json to the model and returns the namespace.
"""
- if json.get('nocompile', False):
- return None
namespace = Namespace(json, source_file)
self.namespaces[namespace.name] = namespace
return namespace
@@ -54,8 +50,7 @@ class Namespace(object):
type_ = Type(self, type_json['id'], type_json)
self.types[type_.name] = type_
for function_json in json.get('functions', []):
- if not function_json.get('nocompile', False):
- self.functions[function_json['name']] = Function(self, function_json)
+ self.functions[function_json['name']] = Function(self, function_json)
class Type(object):
"""A Type defined in the json.
@@ -94,8 +89,7 @@ class Type(object):
self.functions = {}
self.parent = parent
for function_json in json.get('functions', []):
- if not function_json.get('nocompile', False):
- self.functions[function_json['name']] = Function(self, function_json)
+ self.functions[function_json['name']] = Function(self, function_json)
props = []
for prop_name, prop_json in json.get('properties', {}).items():
# TODO(calamity): support functions (callbacks) as properties. The model
« no previous file with comments | « tools/json_schema_compiler/json_schema_test.py ('k') | tools/json_schema_compiler/model_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698