Chromium Code Reviews| 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..5230a934ccf71cd8ba126169dbdf996b26ad850a 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=None): |
|
asargent_no_longer_on_chrome
2013/01/09 18:09:07
would "indent_level" be a better name to more clea
not at google - send to devlin
2013/01/09 18:46:18
Done.
|
| """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 is None: |
| + indent = self._indent_level |
| + self._code.append(Line(((' ' * indent) + line).rstrip(), |
| + substitute=substitute)) |
| return self |
| def IsEmpty(self): |