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

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: Renaming core_api::types->core_api::extension_types. 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
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..e850d9bf748e0d458b4451f8b6badd4e898162a0 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -27,11 +27,16 @@ class Model(object):
def __init__(self):
self.namespaces = {}
- def AddNamespace(self, json, source_file, include_compiler_options=False):
+ def AddNamespace(self,
+ json,
+ source_file,
+ cpp_namespace_pattern,
not at google - send to devlin 2014/08/25 22:22:47 There's a reason a lot of these namespace-level pr
lfg 2014/08/26 16:15:22 I thought this didn't feel right when I had to fix
+ include_compiler_options=False):
"""Add a namespace's json to the model and returns the namespace.
"""
namespace = Namespace(json,
source_file,
+ cpp_namespace_pattern,
include_compiler_options=include_compiler_options)
self.namespaces[namespace.name] = namespace
return namespace
@@ -95,13 +100,18 @@ 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,
+ cpp_namespace_pattern='',
+ include_compiler_options=False):
self.name = json['namespace']
if 'description' not in json:
# TODO(kalman): Go back to throwing an error here.
print('%s must have a "description" field. This will appear '
'on the API summary page.' % self.name)
json['description'] = ''
+ self.cpp_namespace_pattern = cpp_namespace_pattern
self.description = json['description']
self.deprecated = json.get('deprecated', None)
self.unix_name = UnixName(self.name)

Powered by Google App Engine
This is Rietveld 408576698