Skip to content
Myr

fixed a small bug

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 7fb3897 · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:jinja2/compiler.py+4 added-4 removed
323 unmodified lines
324 self.indent()325 self.writeline('for event in parent_root(context):')326 self.indent()327 self.writeline('yield event')328 self.outdent(2 + self.has_known_extends)328 self.outdent(1 + self.has_known_extends)329330 # at this point we now have the blocks collected and can visit them too.331 for name, block in self.blocks.iteritems():332 block_frame = Frame()
9 unmodified lines
342 def visit_Block(self, node, frame):343 """Call a block and register it for the template."""344 # if we know that we are a child template, there is no need to345 # check if we are one346 if self.has_known_extends:346 if self.has_known_extends and frame.toplevel:347 return348 if frame.toplevel:349 self.writeline('if parent_root is None:')350 self.indent()351 self.writeline('for event in block_%s(context):' % node.name)351 self.writeline('for event in context.blocks[-1][%r](context):' % node.name)352 self.indent()353 self.writeline('yield event')354 self.outdent(1 + frame.toplevel)355
149 unmodified lines
505 self.visit(node, frame)506507 def visit_Output(self, node, frame):508 # if we have a known extends statement, we don't output anything509 if self.has_known_extends:509 if self.has_known_extends and frame.toplevel:510 return511512 self.newline(node)513 if self.environment.finalize is unicode:
223 unmodified lines