#NEWLINE# def keep( self , yes ) : #NEWLINE# #INDENT# if ( self . tried is None ) : #NEWLINE# #INDENT# raise Exception ( 'feedback before any value was generated' ) #NEWLINE# #UNINDENT# if yes : #NEWLINE# #INDENT# self . i += 1 #NEWLINE# logging . debug ( 'keeping chunk %d/%d (len==%d)' , self . i , len ( self . data ) , self . size ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . size -= len ( self . data [ self . i ] ) #NEWLINE# self . data = self . tried #NEWLINE# logging . debug ( 'eliminated chunk %d/%d (len==%d)' , ( self . i + 1 ) , ( len ( self . data ) + 1 ) , self . size ) #NEWLINE# if ( len ( self . data ) == 1 ) : #NEWLINE# #INDENT# logging . debug ( 'only one chunk left, assuming it is needed' ) #NEWLINE# self . _reset ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . tried = None