@register.tag
def indentby(parser, token):
 args = token.split_contents()
 largs = len(args)
 if (largs not in (2, 4)):
  raise template.TemplateSyntaxError('%r tag requires 1 or 3 arguments')
 indent_level = args[1]
 if_statement = None
 if (largs == 4):
  if_statement = args[3]
 nodelist = parser.parse(('endindentby',))
 parser.delete_first_token()
 return IndentByNode(nodelist, indent_level, if_statement)

@ register . tag def indentby ( parser , token ) : args = token . split_contents ( ) largs = len ( args ) if ( largs not in ( 2 , 4 ) ) : raise template . TemplateSyntaxError ( '%r tag requires 1 or 3 arguments' ) indent_level = args [ 1 ] if_statement = None if ( largs == 4 ) : if_statement = args [ 3 ] nodelist = parser . parse ( ( 'endindentby' , ) ) parser . delete_first_token ( ) return IndentByNode ( nodelist , indent_level , if_statement )
adds indentation to text between the tags by the given indentation level .