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

Unified Diff: tools/json_schema_compiler/schema_loader.py

Issue 849103005: Cleanup most pylint errors in json_schema_compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/schema_loader.py
diff --git a/tools/json_schema_compiler/schema_loader.py b/tools/json_schema_compiler/schema_loader.py
index b8969910c6b693a6eed4c2da1e07f01d73b84997..818adfd84d7df549cf1727ea079402a64d428fff 100644
--- a/tools/json_schema_compiler/schema_loader.py
+++ b/tools/json_schema_compiler/schema_loader.py
@@ -54,13 +54,16 @@ class SchemaLoader(object):
def ResolveNamespace(self, full_namespace):
filenames = GenerateFilenames(full_namespace)
for path, cpp_namespace in self._include_rules:
+ cpp_namespace_environment = None
+ if cpp_namespace:
+ cpp_namespace_environment = CppNamespaceEnvironment(cpp_namespace)
for filename in reversed(filenames):
filepath = os.path.join(path, filename);
if os.path.exists(os.path.join(self._root, filepath)):
return Model().AddNamespace(
self.LoadSchema(filepath)[0],
filepath,
- environment=CppNamespaceEnvironment(cpp_namespace))
+ environment=cpp_namespace_environment)
return None
def ResolveType(self, full_name, default_namespace):
@@ -78,7 +81,7 @@ class SchemaLoader(object):
def LoadSchema(self, schema):
'''Load a schema definition. The schema parameter must be a file name
with the full path relative to the root.'''
- schema_filename, schema_extension = os.path.splitext(schema)
+ schema_extension = os.path.splitext(schema)[1]
not at google - send to devlin 2015/01/14 22:44:41 ditto
schema_path = os.path.join(self._root, schema)
if schema_extension == '.json':
« tools/json_schema_compiler/preview.py ('K') | « tools/json_schema_compiler/preview.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698