From 42703c9bc25c8e47ff26d98fbae5e737e7bd66d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=92=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Thu, 17 Mar 2016 23:51:15 +0300 Subject: [PATCH] hotfix --- src/file_transfers.py | 4 +++- src/tox.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/file_transfers.py b/src/file_transfers.py index 9f4cd42..b983d81 100644 --- a/src/file_transfers.py +++ b/src/file_transfers.py @@ -2,6 +2,7 @@ # TODO: add support of avatars from toxcore_enums_and_consts import TOX_FILE_KIND from os.path import basename, getsize +from time import time TOX_FILE_TRANSFER_STATE = { @@ -13,12 +14,13 @@ TOX_FILE_TRANSFER_STATE = { class FileTransfer(object): - def __init__(self, path, tox, friend_number, file_number = None): + def __init__(self, path, tox, friend_number, file_number=None): self._path = path self._tox = tox self._friend_number = friend_number self.state = TOX_FILE_TRANSFER_STATE['RUNNING'] self._file_number = file_number + self._creation_time = time() def set_tox(self, tox): self._tox = tox diff --git a/src/tox.py b/src/tox.py index 2767660..b1fb202 100644 --- a/src/tox.py +++ b/src/tox.py @@ -36,7 +36,7 @@ class LibToxCore(object): def string_to_bin(tox_id): - return c_char_p(tox_id.decode('hex')) + return c_char_p(tox_id.decode('hex')) if tox_id is not None else None def bin_to_string(raw_id, length):