From 1897fa762a00d493fc92aabffd8d66bf2e22a5a7 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Mon, 21 Mar 2016 23:51:29 +0300 Subject: [PATCH] sending fix --- src/callbacks.py | 2 +- src/file_transfers.py | 5 +---- src/list_items.py | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index d69e614..31f480a 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -169,7 +169,7 @@ def file_recv_chunk(tox, friend_number, file_number, position, chunk, length, us def file_chunk_request(tox, friend_number, file_number, position, size, user_data): - invoke_in_main_thread(Profile.get_instance().outgoing_chunk, + Profile.get_instance().outgoing_chunk( friend_number, file_number, position, diff --git a/src/file_transfers.py b/src/file_transfers.py index 78de97d..91412f2 100644 --- a/src/file_transfers.py +++ b/src/file_transfers.py @@ -79,10 +79,7 @@ class SendTransfer(FileTransfer): if size: self._file.seek(position) data = self._file.read(size) - try: - self._tox.file_send_chunk(self._friend_number, self._file_number, position, data) - except: - print self._friend_number, self._file_number, position, data + self._tox.file_send_chunk(self._friend_number, self._file_number, position, data) self._done += size self._state_changed.signal.emit(self.state, self._done / self._size) else: diff --git a/src/list_items.py b/src/list_items.py index 4108358..75fbfbf 100644 --- a/src/list_items.py +++ b/src/list_items.py @@ -241,8 +241,6 @@ class FileTransferItem(QtGui.QListWidget): @QtCore.Slot(int, float) def update(self, state, progress): self.pb.setValue(int(progress * 100)) - #self.pb.repaint() - print state, progress if state == TOX_FILE_TRANSFER_STATE['CANCELED']: self.setStyleSheet('QListWidget { background-color: red; }') self.cancel.setVisible(False)