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

Unified Diff: tools/json_schema_compiler/cpp_type_generator.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/cpp_type_generator.py
diff --git a/tools/json_schema_compiler/cpp_type_generator.py b/tools/json_schema_compiler/cpp_type_generator.py
index 6bec67e43c03187e15d7d9cbba51b823cb016a5c..44ff97898f24e53b19babac6d343dac21e208634 100644
--- a/tools/json_schema_compiler/cpp_type_generator.py
+++ b/tools/json_schema_compiler/cpp_type_generator.py
@@ -244,30 +244,30 @@ class CppTypeGenerator(object):
deps |= self._TypeDependencies(p.type_, hard=not p.optional)
return deps
- def GeneratePropertyValues(self, property, line, nodoc=False):
+ def GeneratePropertyValues(self, prop, line, nodoc=False):
"""Generates the Code to display all value-containing properties.
"""
c = Code()
if not nodoc:
- c.Comment(property.description)
+ c.Comment(prop.description)
- if property.value is not None:
+ if prop.value is not None:
c.Append(line % {
- "type": self.GetCppType(property.type_),
- "name": property.name,
- "value": property.value
+ "type": self.GetCppType(prop.type_),
+ "name": prop.name,
+ "value": prop.value
})
else:
has_child_code = False
- c.Sblock('namespace %s {' % property.name)
- for child_property in property.type_.properties.values():
+ c.Sblock('namespace %s {' % prop.name)
+ for child_property in prop.type_.properties.values():
child_code = self.GeneratePropertyValues(child_property,
line,
nodoc=nodoc)
if child_code:
has_child_code = True
c.Concat(child_code)
- c.Eblock('} // namespace %s' % property.name)
+ c.Eblock('} // namespace %s' % prop.name)
if not has_child_code:
c = None
return c

Powered by Google App Engine
This is Rietveld 408576698