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

Unified Diff: tools/json_schema_compiler/model.py

Issue 487533005: Add support for references in different paths in apis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/h_generator.py ('k') | tools/json_schema_compiler/schema_loader.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 ed8a2ec404edef066279720ad422c3ee7a6c4a43..16530e7f465b2e523958c8e00afdc8c1e6f652d1 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -27,12 +27,17 @@ class Model(object):
def __init__(self):
self.namespaces = {}
- def AddNamespace(self, json, source_file, include_compiler_options=False):
+ def AddNamespace(self,
+ json,
+ source_file,
+ include_compiler_options=False,
+ environment=None):
"""Add a namespace's json to the model and returns the namespace.
"""
namespace = Namespace(json,
source_file,
- include_compiler_options=include_compiler_options)
+ include_compiler_options=include_compiler_options,
+ environment=environment)
self.namespaces[namespace.name] = namespace
return namespace
@@ -95,7 +100,11 @@ class Namespace(object):
- |compiler_options| the compiler_options dict, only not empty if
|include_compiler_options| is True
"""
- def __init__(self, json, source_file, include_compiler_options=False):
+ def __init__(self,
+ json,
+ source_file,
+ include_compiler_options=False,
+ environment=None):
self.name = json['namespace']
if 'description' not in json:
# TODO(kalman): Go back to throwing an error here.
@@ -119,6 +128,7 @@ class Namespace(object):
self.compiler_options = json.get('compiler_options', {})
else:
self.compiler_options = {}
+ self.environment = environment
self.documentation_options = json.get('documentation_options', {})
« no previous file with comments | « tools/json_schema_compiler/h_generator.py ('k') | tools/json_schema_compiler/schema_loader.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698