#NEWLINE# def send( self , db_uid , command , arguments , * args , **kwargs ) : #NEWLINE# #INDENT# orig_timeout = ms_to_sec ( self . timeout ) #NEWLINE# timeout = kwargs . pop ( 'timeout' , 0 ) #NEWLINE# compression = kwargs . pop ( 'compression' , False ) #NEWLINE# if ( timeout > 0 ) : #NEWLINE# #INDENT# self . timeout = timeout #NEWLINE# #UNINDENT# self . socket . send_multipart ( [ Request ( db_uid = db_uid , command = command , args = arguments , meta = { #NEWLINE# #INDENT# 'compression' : compression , #NEWLINE# #UNINDENT# } ) ] ) #NEWLINE# try : #NEWLINE# #INDENT# ( raw_header , raw_response ) = self . socket . recv_multipart ( ) #NEWLINE# header = ResponseHeader ( raw_header ) #NEWLINE# response = Response ( raw_response , compression = compression ) #NEWLINE# if ( header . status == FAILURE_STATUS ) : #NEWLINE# #INDENT# raise ELEVATOR_ERROR [ header . err_code ] ( header . err_msg ) #NEWLINE# #UNINDENT# #UNINDENT# except zmq . ZMQError : #NEWLINE# #INDENT# self . timeout = orig_timeout #NEWLINE# raise TimeoutError ( 'Timeout : Server did not respond in time' ) #NEWLINE# #UNINDENT# self . timeout = orig_timeout #NEWLINE# return response . datas