setup.py fixes

This commit is contained in:
ingvar1995 2018-05-18 21:07:59 +03:00
parent a575312167
commit 88786b0398
2 changed files with 17 additions and 6 deletions

View file

@ -38,13 +38,13 @@ class Friend(contact.Contact):
def clear_unsent_files(self):
self._corr = list(filter(lambda x: type(x) is not UnsentFileMessage, self._corr))
def remove_invalid_unsent_files(self): # TODO: fix
def remove_invalid_unsent_files(self):
def is_valid(message):
if type(message) is not UnsentFileMessage:
return True
if message.get_data()[1] is not None:
if message.data is not None:
return True
return os.path.exists(message.get_data()[0])
return os.path.exists(message.path)
self._corr = list(filter(is_valid, self._corr))