def reind_proc(self, inputstring, **kwargs):
        """Add back indentation."""
        out = []
        level = 0

        for line in inputstring.splitlines():
            line, comment = split_comment(line.strip())

            indent, line = split_leading_indent(line)
            level += ind_change(indent)

            if line:
                line = " " * self.tabideal * level + line

            line, indent = split_trailing_indent(line)
            level += ind_change(indent)

            line = (line + comment).rstrip()
            out.append(line)

        if level != 0:
            complain(CoconutInternalException("non-zero final indentation level", level))
        return "\n".join(out)
def reind_proc ( self , inputstring , ** kwargs ) : out = [ ] level = 0 for line in inputstring . splitlines ( ) : line , comment = split_comment ( line . strip ( ) ) indent , line = split_leading_indent ( line ) level += ind_change ( indent ) if line : line = " " * self . tabideal * level + line line , indent = split_trailing_indent ( line ) level += ind_change ( indent ) line = ( line + comment ) . rstrip ( ) out . append ( line ) if level != 0 : complain ( CoconutInternalException ( "non-zero final indentation level" , level ) ) return "\n" . join ( out )
Add back indentation.