#NEWLINE# @ register . tag #NEWLINE# def sitetree_children( parser , token ) : #NEWLINE# #INDENT# 'Parses sitetree_children tag parameters.\n\n       Six arguments:\n           {% sitetree_children of someitem for menu template "sitetree/mychildren.html" %}\n           Used to render child items of specific site tree \'someitem\'\n           using template "sitetree/mychildren.html" for menu navigation.\n\n           Basically template argument should contain path to current template itself.\n\n           Allowed navigation types: 1) menu; 2) sitetree.\n\n    ' #NEWLINE# tokens = token . split_contents ( ) #NEWLINE# use_template = detect_clause ( parser , 'template' , tokens ) #NEWLINE# tokens_num = len ( tokens ) #NEWLINE# clauses_in_places = ( ( tokens_num == 5 ) and ( tokens [ 1 ] == 'of' ) and ( tokens [ 3 ] == 'for' ) and ( tokens [ 4 ] in ( 'menu' , 'sitetree' ) ) ) #NEWLINE# if ( clauses_in_places and ( use_template is not None ) ) : #NEWLINE# #INDENT# tree_item = tokens [ 2 ] #NEWLINE# navigation_type = tokens [ 4 ] #NEWLINE# return sitetree_childrenNode ( tree_item , navigation_type , use_template ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise template . TemplateSyntaxError ( ( '%r tag requires six arguments. E.g. {%% sitetree_children of someitem for menu template "sitetree/mychildren.html" %%}.' % tokens [ 0 ] ) )