plugins updates
This commit is contained in:
parent
34dd74ad48
commit
b0389537a1
@ -26,7 +26,7 @@ def log(name, data):
|
||||
:param data: data for saving in log
|
||||
"""
|
||||
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:
|
||||
@ -129,7 +129,7 @@ class PluginSuperClass:
|
||||
"""
|
||||
App is closing
|
||||
"""
|
||||
pass
|
||||
self.stop()
|
||||
|
||||
def command(self, command):
|
||||
"""
|
||||
@ -169,6 +169,7 @@ class PluginSuperClass:
|
||||
def load_settings(self):
|
||||
"""
|
||||
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:
|
||||
data = fl.read()
|
||||
|
@ -249,7 +249,10 @@ class Profile(basecontact.BaseContact, Singleton):
|
||||
active_friend = property(get_active, set_active)
|
||||
|
||||
def get_last_message(self):
|
||||
if self._active_friend + 1:
|
||||
return self._contacts[self._active_friend].get_last_message_text()
|
||||
else:
|
||||
return ''
|
||||
|
||||
def get_active_number(self):
|
||||
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._screen.active_call()
|
||||
if friend_number in self._incoming_calls:
|
||||
self._incoming_calls.remove(friend_number)
|
||||
if hasattr(self, '_call_widget'):
|
||||
del self._call_widget
|
||||
|
Loading…
Reference in New Issue
Block a user