#NEWLINE# def parse_next_message( self ) : #NEWLINE# #INDENT# message = None #NEWLINE# remainder = self . message_buffer #NEWLINE# message_data = '' #NEWLINE# while ( ( message is None ) and ( len ( self . message_buffer ) > 1 ) ) : #NEWLINE# #INDENT# ( message_length , message_start ) = _DecodeVarint ( self . message_buffer , 0 ) #NEWLINE# if ( message_length > self . MAX_PROTOBUF_MESSAGE_LENGTH ) : #NEWLINE# #INDENT# self . message_buffer = self . message_buffer [ 1 : ] #NEWLINE# continue #NEWLINE# #UNINDENT# if ( ( message_start + message_length ) > len ( self . message_buffer ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# message_data = self . message_buffer [ message_start : ( message_start + message_length ) ] #NEWLINE# remainder = self . message_buffer [ ( message_start + message_length ) : ] #NEWLINE# message = ProtobufFormatter . deserialize ( message_data ) #NEWLINE# if ( message is None ) : #NEWLINE# #INDENT# self . message_buffer = self . message_buffer [ 1 : ] #NEWLINE# #UNINDENT# #UNINDENT# self . message_buffer = remainder #NEWLINE# return message