#NEWLINE# @ idiokit . stream #NEWLINE# def walk_mail( self , uid , path = ( ) , headers = [ ] ) : #NEWLINE# #INDENT# if ( not path ) : #NEWLINE# #INDENT# header = ( yield self . get_header ( uid , 'HEADER' ) ) #NEWLINE# if ( header is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( header . get_content_maintype ( ) != 'multipart' ) : #NEWLINE# #INDENT# ( yield idiokit . send ( 'TEXT' , tuple ( ( headers + [ path ] ) ) ) ) #NEWLINE# return #NEWLINE# #UNINDENT# headers = ( headers + [ header ] ) #NEWLINE# #UNINDENT# path = ( list ( path ) + [ 0 ] ) #NEWLINE# while True : #NEWLINE# #INDENT# path [ ( - 1 ) ] += 1 #NEWLINE# path_str = '.' . join ( map ( str , path ) ) #NEWLINE# header = ( yield self . get_header ( uid , ( path_str + '.MIME' ) ) ) #NEWLINE# if ( header is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( header . get_content_maintype ( ) == 'multipart' ) : #NEWLINE# #INDENT# ( yield self . walk_mail ( uid , path , ( headers + [ header ] ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( yield idiokit . send ( path_str , tuple ( ( headers + [ header ] ) ) ) )