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

Unified Diff: tools/json_schema_compiler/code.py

Issue 11747025: Run the JSON Schema Compiler's bundle compilation on JSON files. Previously it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ms release build Created 7 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
« no previous file with comments | « chrome/common/extensions_api_resources.grd ('k') | tools/json_schema_compiler/compiler.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/code.py
diff --git a/tools/json_schema_compiler/code.py b/tools/json_schema_compiler/code.py
index 07f657474472ea53fc459eae33df5bcff21cc85b..e4326d49d808f1dc4d03373c5273b65678b683d8 100644
--- a/tools/json_schema_compiler/code.py
+++ b/tools/json_schema_compiler/code.py
@@ -14,15 +14,17 @@ class Code(object):
self._indent_size = indent_size
self._comment_length = comment_length
- def Append(self, line='', substitute=True):
+ def Append(self, line='', substitute=True, indent_level=None):
"""Appends a line of code at the current indent level or just a newline if
line is not specified. Trailing whitespace is stripped.
substitute: indicated whether this line should be affected by
code.Substitute().
"""
- self._code.append(Line(((' ' * self._indent_level) + line).rstrip(),
- substitute=substitute))
+ if indent_level is None:
+ indent_level = self._indent_level
+ self._code.append(Line(((' ' * indent_level) + line).rstrip(),
+ substitute=substitute))
return self
def IsEmpty(self):
« no previous file with comments | « chrome/common/extensions_api_resources.grd ('k') | tools/json_schema_compiler/compiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698