#NEWLINE# def next( self ) : #NEWLINE# #INDENT# if ( self . tried is not None ) : #NEWLINE# #INDENT# raise Exception ( 'no feedback received on last value generated' ) #NEWLINE# #UNINDENT# while True : #NEWLINE# #INDENT# self . tried = self . data [ : ] #NEWLINE# try : #NEWLINE# #INDENT# rmd = self . tried . pop ( self . i ) #NEWLINE# if ( ( len ( rmd ) == 1 ) and ( rmd [ 0 ] == '\n' ) ) : #NEWLINE# #INDENT# self . keep ( True ) #NEWLINE# continue #NEWLINE# #UNINDENT# return self . formatter ( sum ( self . tried , [ ] ) ) #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# self . tried = None #NEWLINE# if ( ( not self . data ) or ( ( len ( self . data [ 0 ] ) == 1 ) and ( not self . found_something ) ) ) : #NEWLINE# #INDENT# raise StopIteration #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _reset ( )