#NEWLINE# def _push_event_callback( self , commands ) : #NEWLINE# #INDENT# 'Handle event from the cloud.' #NEWLINE# logging . info ( 'Processing %d commands' , len ( commands ) ) #NEWLINE# for command in commands : #NEWLINE# #INDENT# command_type = command . pop ( 'type' , None ) #NEWLINE# proxy = self . _proxies . get ( command_type , None ) #NEWLINE# if ( proxy is None ) : #NEWLINE# #INDENT# logging . error ( "Proxy type '%s' unrecognised" , self ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# proxy . handle_command ( command ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logging . error ( 'Error handling command.' , exc_info = sys . exc_info ( ) )