diff options
Diffstat (limited to 'mako/pygen.py')
-rw-r--r-- | mako/pygen.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mako/pygen.py b/mako/pygen.py index 265c0b0..603676d 100644 --- a/mako/pygen.py +++ b/mako/pygen.py @@ -54,14 +54,16 @@ class PythonPrinter(object): self.stream.write("\n" * num) self._update_lineno(num) - def write_indented_block(self, block): + def write_indented_block(self, block, starting_lineno=None): """print a line or lines of python which already contain indentation. The indentation of the total block of lines will be adjusted to that of the current indent level.""" self.in_indent_lines = False - for l in re.split(r"\r?\n", block): + for i, l in enumerate(re.split(r"\r?\n", block)): self.line_buffer.append(l) + if starting_lineno is not None: + self.start_source(starting_lineno + i) self._update_lineno(1) def writelines(self, *lines): |