#NEWLINE# def annotate_all_messages( self ) : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# msg = self . get_unannotated_message ( ) #NEWLINE# if ( msg is not None ) : #NEWLINE# #INDENT# tweet_id = msg [ b'tweet_id' ] #NEWLINE# tweet_text = msg [ b'tweet_text' ] #NEWLINE# config . logging . info ( ( 'Asking API for results for "%r"' % repr ( tweet_text ) ) ) #NEWLINE# response = self . call_api ( tweet_text ) #NEWLINE# self . store_raw_response ( msg , response ) #NEWLINE# if self . is_brand_of ( self . brand , tweet_id ) : #NEWLINE# #INDENT# cls = sql_convenience . CLASS_IN #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cls = sql_convenience . CLASS_OUT #NEWLINE# #UNINDENT# sql_convenience . update_class ( tweet_id , self . destination_table , cls ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# break