plugins updates

This commit is contained in:
ingvar1995 2016-10-29 17:39:48 +03:00
parent 34dd74ad48
commit b0389537a1
2 changed files with 9 additions and 4 deletions

View file

@ -26,7 +26,7 @@ def log(name, data):
:param data: data for saving in log :param data: data for saving in log
""" """
with open(path_to_data(name) + 'logs.txt', 'a') as fl: with open(path_to_data(name) + 'logs.txt', 'a') as fl:
fl.write(bytes(data, 'utf-8') + b'\n') fl.write(str(data) + '\n')
class PluginSuperClass: class PluginSuperClass:
@ -129,7 +129,7 @@ class PluginSuperClass:
""" """
App is closing App is closing
""" """
pass self.stop()
def command(self, command): def command(self, command):
""" """
@ -169,6 +169,7 @@ class PluginSuperClass:
def load_settings(self): def load_settings(self):
""" """
This method loads settings of plugin and returns raw data This method loads settings of plugin and returns raw data
If file doesn't this method raises exception
""" """
with open(path_to_data(self._short_name) + 'settings.json', 'rb') as fl: with open(path_to_data(self._short_name) + 'settings.json', 'rb') as fl:
data = fl.read() data = fl.read()

View file

@ -249,7 +249,10 @@ class Profile(basecontact.BaseContact, Singleton):
active_friend = property(get_active, set_active) active_friend = property(get_active, set_active)
def get_last_message(self): def get_last_message(self):
if self._active_friend + 1:
return self._contacts[self._active_friend].get_last_message_text() return self._contacts[self._active_friend].get_last_message_text()
else:
return ''
def get_active_number(self): def get_active_number(self):
return self._contacts[self._active_friend].number if self._active_friend + 1 else -1 return self._contacts[self._active_friend].number if self._active_friend + 1 else -1
@ -1200,6 +1203,7 @@ class Profile(basecontact.BaseContact, Singleton):
""" """
self._call.accept_call(friend_number, audio, video) self._call.accept_call(friend_number, audio, video)
self._screen.active_call() self._screen.active_call()
if friend_number in self._incoming_calls:
self._incoming_calls.remove(friend_number) self._incoming_calls.remove(friend_number)
if hasattr(self, '_call_widget'): if hasattr(self, '_call_widget'):
del self._call_widget del self._call_widget