#NEWLINE# def match_repeat( self , argv ) : #NEWLINE# #INDENT# old_status = None #NEWLINE# new_status = argv . status ( ) #NEWLINE# full_match_count = 0 #NEWLINE# history_values = [ self . dump_value ( ) ] #NEWLINE# logger . debug ( 'matching %s repeatedly, start: %s' , self , argv ) #NEWLINE# while ( ( old_status != new_status ) and argv ) : #NEWLINE# #INDENT# self . reset ( ) #NEWLINE# old_status = new_status #NEWLINE# result = self . match_oneline ( argv ) #NEWLINE# if result : #NEWLINE# #INDENT# full_match_count += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# history_values . append ( self . dump_value ( ) ) #NEWLINE# new_status = argv . status ( ) #NEWLINE# #UNINDENT# logger . debug ( 'matching %s %s time(s)' , self , full_match_count ) #NEWLINE# if full_match_count : #NEWLINE# #INDENT# if ( len ( self ) == 1 ) : #NEWLINE# #INDENT# merged_value = history_values [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# merged_value = self . merge_value ( history_values ) #NEWLINE# #UNINDENT# logger . debug ( 'restore merged value %s for %s' , merged_value , self ) #NEWLINE# self . load_value ( merged_value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( len ( history_values ) == 1 ) #NEWLINE# self . load_value ( history_values [ 0 ] ) #NEWLINE# #UNINDENT# return full_match_count