#NEWLINE# def dispatch_visit( self , node ) : #NEWLINE# #INDENT# cls = node . __class__ #NEWLINE# if ( cls is nodes . section ) : #NEWLINE# #INDENT# section = { #NEWLINE# #INDENT# 'ids' : node [ 'ids' ] , #NEWLINE# 'names' : node [ 'names' ] , #NEWLINE# 'title' : '' , #NEWLINE# 'children' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# if isinstance ( self . current , dict ) : #NEWLINE# #INDENT# self . current [ 'children' ] . append ( section ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . current . append ( section ) #NEWLINE# #UNINDENT# self . push ( section ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( cls is nodes . title ) : #NEWLINE# #INDENT# self . text = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( node is nodes . Text ) : #NEWLINE# #INDENT# self . text += node