(self, context)
return '\n'.join([_PrefixNonBlank(line) for line in lines.split('\n')])
Reindent the block inside the tag scope.
Reindent the block inside the tag scope.
Reindent the block inside the tag scope .
def render(self, context):  # pylint: disable=g-bad-name
    """Reindent the block inside the tag scope."""
    current_indent = context.get(_CURRENT_INDENT, 0)
    current_indent_level = context.get(_CURRENT_LEVEL, 0)
    # How much extra indent will this level add
    extra = (_GetFromContext(context, _LEVEL_INDENT) * self._levels)
    # Set the new effective indent of this block.  Tags which wrap text to
    # the line limit must use this value to determine their actual indentation.
    context[_CURRENT_INDENT] = current_indent + extra
    context[_CURRENT_LEVEL] = current_indent_level + self._levels
    lines = self._nodelist.render(context)
    context[_CURRENT_INDENT] = current_indent
    context[_CURRENT_LEVEL] = current_indent_level
    # We only have to prefix the lines in this row by the extra indent, because
    # the outer scope will be adding its own indent as well.
    prefix = ' ' * extra

    def _PrefixNonBlank(s):
      x = s.rstrip()
      if x:
        x = '%s%s' % (prefix, x)
      return x
    return '\n'.join([_PrefixNonBlank(line) for line in lines.split('\n')])
def render ( self , context ) : # pylint: disable=g-bad-name current_indent = context . get ( _CURRENT_INDENT , 0 ) current_indent_level = context . get ( _CURRENT_LEVEL , 0 ) # How much extra indent will this level add extra = ( _GetFromContext ( context , _LEVEL_INDENT ) * self . _levels ) # Set the new effective indent of this block.  Tags which wrap text to # the line limit must use this value to determine their actual indentation. context [ _CURRENT_INDENT ] = current_indent + extra context [ _CURRENT_LEVEL ] = current_indent_level + self . _levels lines = self . _nodelist . render ( context ) context [ _CURRENT_INDENT ] = current_indent context [ _CURRENT_LEVEL ] = current_indent_level # We only have to prefix the lines in this row by the extra indent, because # the outer scope will be adding its own indent as well. prefix = ' ' * extra def _PrefixNonBlank ( s ) : x = s . rstrip ( ) if x : x = '%s%s' % ( prefix , x ) return x return '\n' . join ( [ _PrefixNonBlank ( line ) for line in lines . split ( '\n' ) ] )