#NEWLINE# def print_tree( elem , lvl = 0 ) : #NEWLINE# #INDENT# if ( isinstance ( elem , list ) or isinstance ( elem , Container ) ) : #NEWLINE# #INDENT# if isinstance ( elem , Container ) : #NEWLINE# #INDENT# print ( '{}{}' . format ( ( '   ' * lvl ) , elem . name ) ) #NEWLINE# #UNINDENT# for sub_elem in elem : #NEWLINE# #INDENT# print_tree ( sub_elem , ( lvl + 1 ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( elem , ContentLine ) : #NEWLINE# #INDENT# print ( '{}{}{}' . format ( ( '   ' * lvl ) , elem . name , elem . params , elem . value ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'Wuuut?' )