Home | History | Annotate | Download | only in jinja2

Lines Matching refs:writeline

433         self.writeline('%s = []' % frame.buffer)
438 self.writeline('if context.eval_ctx.autoescape:')
440 self.writeline('return Markup(concat(%s))' % frame.buffer)
442 self.writeline('else:')
444 self.writeline('return concat(%s)' % frame.buffer)
447 self.writeline('return Markup(concat(%s))' % frame.buffer)
449 self.writeline('return concat(%s)' % frame.buffer)
462 self.writeline('yield ', node)
464 self.writeline('%s.append(' % frame.buffer, node)
483 self.writeline('if 0: yield None')
485 self.writeline('pass')
507 def writeline(self, x, node=None, extra=0):
575 self.writeline('l_%s = context.resolve(%r)' % (name, name))
587 self.writeline('%s = environment.%s[%r]' %
597 self.writeline('%sdummy(%s)' % (
615 self.writeline('%s = l_%s' % (ident, name))
621 self.writeline(' = '.join(to_declare) + ' = missing')
627 self.writeline('l_%s = %s' % (name, alias))
636 self.writeline(' = '.join(to_delete) + ' = missing')
722 self.writeline('def macro(%s):' % ', '.join(args), node)
762 self.writeline('from __future__ import division')
763 self.writeline('from jinja2.runtime import ' + ', '.join(exported))
765 self.writeline('dummy = lambda *x: None')
788 self.writeline('from %s import %s as %s' %
791 self.writeline('import %s as %s' % (imp, alias))
794 self.writeline('name = %r' % self.name)
797 self.writeline('def root(context%s):' % envenv, extra=1)
806 self.writeline('parent_template = None')
809 self.writeline('l_self = TemplateReference(context)')
819 self.writeline('if parent_template is not None:')
821 self.writeline('for event in parent_template.'
824 self.writeline('yield event')
832 self.writeline('def block_%s(context%s):' % (name, envenv),
838 self.writeline('l_self = TemplateReference(context)')
841 self.writeline('l_super = context.super(%r, '
848 self.writeline('blocks = {%s}' % ', '.join('%r: block_%s' % (x, x)
853 self.writeline('debug_info = %r' % '&'.join('%s=%s' % x for x
865 self.writeline('if parent_template is None:')
869 self.writeline('for event in context.blocks[%r][0](%s):' % (
891 self.writeline('if parent_template is not None:')
893 self.writeline('raise TemplateRuntimeError(%r)' %
903 self.writeline('parent_template = environment.get_template(', node)
906 self.writeline('for name, parent_block in parent_template.'
909 self.writeline('context.blocks.setdefault(name, []).'
927 self.writeline('try:')
939 self.writeline('template = environment.%s(' % func_name, node)
944 self.writeline('except TemplateNotFound:')
946 self.writeline('pass')
948 self.writeline('else:')
952 self.writeline('for event in template.root_render_func('
956 self.writeline('for event in template.module._body_stream:')
969 self.writeline('l_%s = ' % node.target, node)
980 self.writeline('context.exported_vars.discard(%r)' % node.target)
1001 self.writeline('l_%s = getattr(included_template, '
1003 self.writeline('if l_%s is missing:' % alias)
1005 self.writeline('l_%s = environment.undefined(%r %% '
1023 self.writeline('context.vars[%r] = l_%s' % (name, name))
1025 self.writeline('context.vars.update({%s})' % ', '.join(
1030 self.writeline('context.exported_vars.discard(%r)' %
1033 self.writeline('context.exported_vars.difference_'
1062 self.writeline('def loop(reciter, loop_render_func, depth=0):', node)
1070 self.writeline('l_loop = missing')
1080 self.writeline('%s = 1' % iteration_indicator)
1087 self.writeline("l_loop = environment.undefined(%r, name='loop')" %
1094 self.writeline('for ', node)
1128 self.writeline('if not ')
1132 self.writeline('continue')
1138 self.writeline('%s = 0' % iteration_indicator)
1142 self.writeline('if %s:' % iteration_indicator)
1164 self.writeline('if ', node)
1171 self.writeline('else:')
1182 self.writeline('context.vars[%r] = ' % node.name)
1190 self.writeline('caller = ')
1226 self.writeline('if parent_template is None:')
1264 self.writeline('%s.append(' % frame.buffer)
1266 self.writeline('%s.extend((' % frame.buffer)
1272 self.writeline('yield ' + val)
1274 self.writeline(val + ', ')
1277 self.writeline('yield ', item)
1298 self.writeline(len(body) == 1 and ')' or '))')
1310 self.writeline('yield ')
1330 self.writeline(')')
1356 self.writeline('context.vars[%r] = l_%s' % (name, name))
1358 self.writeline('context.vars.update({')
1366 self.writeline('context.exported_vars.add(%r)' %
1369 self.writeline('context.exported_vars.update((%s))' %
1608 self.writeline('continue', node)
1611 self.writeline('break', node)
1623 self.writeline('context.eval_ctx.%s = ' % keyword.key)
1635 self.writeline('%s = context.eval_ctx.save()' % old_ctx_name)
1640 self.writeline('context.eval_ctx.revert(%s)' % old_ctx_name)