Beispiel #1
0
 def doReportCancelItems(self, *args, **kwargs):
     """
     Action method.
     """
     for item in self.results:
         p2p_stats.count_outbox(self.remote_idurl, item.proto, 'failed', 0)
         callback.run_finish_file_sending_callbacks(self, item, 'failed', 0,
                                                    self.error_message)
Beispiel #2
0
 def doReportItem(self, arg):
     """
     Action method.
     """
     assert self.popped_item
     p2p_stats.count_outbox(self.remote_idurl, self.popped_item.proto,
                            self.popped_item.status,
                            self.popped_item.bytes_sent)
     callback.run_finish_file_sending_callbacks(
         self, self.popped_item, self.popped_item.status,
         self.popped_item.bytes_sent, self.popped_item.error_message)
     self.popped_item = None
Beispiel #3
0
 def doReportItem(self, *args, **kwargs):
     """
     Action method.
     """
     if not self.popped_item:
         raise Exception('Current outgoing item not exist')
     p2p_stats.count_outbox(self.remote_idurl, self.popped_item.proto,
                            self.popped_item.status,
                            self.popped_item.bytes_sent)
     callback.run_finish_file_sending_callbacks(
         self, self.popped_item, self.popped_item.status,
         self.popped_item.bytes_sent, self.popped_item.error_message)
     self.popped_item = None
Beispiel #4
0
 def doReportCancelItems(self, *args, **kwargs):
     """
     Action method.
     """
     for item in self.results:
         p2p_stats.count_outbox(self.remote_idurl, item.proto, 'failed', 0)
         callback.run_finish_file_sending_callbacks(self, item, 'failed', 0,
                                                    self.error_message)
         if _Debug:
             lg.out(4,
                    '\033[2;49;90mCANCELED %s://%s TID:%s\033[0m' %
                    (item.proto, item.host, item.transfer_id),
                    log_name='packet')
Beispiel #5
0
 def doReportItem(self, *args, **kwargs):
     """
     Action method.
     """
     if not self.popped_item:
         raise Exception('Current outgoing item not exist')
     p2p_stats.count_outbox(self.remote_idurl, self.popped_item.proto,
                            self.popped_item.status,
                            self.popped_item.bytes_sent)
     callback.run_finish_file_sending_callbacks(
         self, self.popped_item, self.popped_item.status,
         self.popped_item.bytes_sent, self.popped_item.error_message)
     if _Debug:
         lg.out(4,
                '\033[2;49;90mSENT %d bytes to %s://%s TID:%s\033[0m' %
                (self.popped_item.bytes_sent, self.popped_item.proto,
                 self.popped_item.host, self.popped_item.transfer_id),
                log_name='packet')
     self.popped_item = None