Beispiel #1
0
 def send_add_url(self):
     data = raw_input ( "TYPE URL:" )
     self.log.info('URL: %s', data)
     send_cmd = {}
     send_cmd['command'] = ADD_URL
     send_cmd['url'] = data
     self.log.info('Message with ADD URL: %s', send_cmd)
     send_msg(self.sock, send_cmd)
Beispiel #2
0
 def _clientthread(self, conn):
     self.log.info('New thread')
     try:
         self.log.info('TRY TO GET REQUEST')
         msg = receive_answer(conn)
         self.log.info('Message: %s', msg)
         self.log.info(msg)
         answer = self.performance_messages_request(msg)
         self.log.info('Answer for client request: %s', answer)
         send_msg(conn, answer)
         conn.close()
     except Exception:
         self.log.info('Exception in processing request')
         self.log.info(traceback.format_exc())
Beispiel #3
0
 def _clientthread(self, conn):
     self.log.info("New thread")
     try:
         self.log.info("TRY TO GET REQUEST")
         msg = receive_answer(conn)
         self.log.info("Message: %s", msg)
         self.log.info(msg)
         answer = self.performance_messages_request(msg)
         self.log.info("Answer for client request: %s", answer)
         send_msg(conn, answer)
         conn.close()
     except Exception:
         self.log.info("Exception in processing request")
         self.log.info(traceback.format_exc())
Beispiel #4
0
 def send_request_to_get_status_list(self):
     send_cmd = {}
     send_cmd['command'] = STATUS
     send_msg(self.sock, send_cmd)
Beispiel #5
0
 def send_request_to_get_single_status(self, url_id):
     send_cmd = {}
     send_cmd['command'] = STATUS
     send_cmd['download_id'] = url_id
     send_msg(self.sock, send_cmd)
Beispiel #6
0
 def send_request_to_delete(self, id):
     send_cmd = {}
     send_cmd['command'] = DEL_FILE
     send_cmd['id'] = id
     send_msg(self.sock, send_cmd)