Commit 10e85b6e authored by Tijmen de Mes's avatar Tijmen de Mes

Syntax fixes

parent d4d559ab
...@@ -168,7 +168,7 @@ class AccountModel(QAbstractListModel): ...@@ -168,7 +168,7 @@ class AccountModel(QAbstractListModel):
if notification.sender is not BonjourAccount(): if notification.sender is not BonjourAccount():
registrar = notification.data.registrar registrar = notification.data.registrar
self.accounts[position].registrar = "%s:%s:%s" % (registrar.transport, registrar.address, registrar.port) self.accounts[position].registrar = "%s:%s:%s" % (registrar.transport, registrar.address, registrar.port)
self.dataChanged.emit(self.index(position), self.index(position)) self.dataChanged.emit(self.index(position), self.index(position))
notification.center.post_notification('SIPRegistrationInfoDidChange', sender=notification.sender) notification.center.post_notification('SIPRegistrationInfoDidChange', sender=notification.sender)
...@@ -177,7 +177,7 @@ class AccountModel(QAbstractListModel): ...@@ -177,7 +177,7 @@ class AccountModel(QAbstractListModel):
position = self.accounts.index(notification.sender) position = self.accounts.index(notification.sender)
except ValueError: except ValueError:
return return
self.accounts[position].registration_state = None self.accounts[position].registration_state = None
self.accounts[position].registrar = None self.accounts[position].registrar = None
self.dataChanged.emit(self.index(position), self.index(position)) self.dataChanged.emit(self.index(position), self.index(position))
...@@ -188,14 +188,14 @@ class AccountModel(QAbstractListModel): ...@@ -188,14 +188,14 @@ class AccountModel(QAbstractListModel):
position = self.accounts.index(notification.sender) position = self.accounts.index(notification.sender)
except ValueError: except ValueError:
return return
reason = 'Unknown reason' reason = 'Unknown reason'
if hasattr(notification.data, 'error'): if hasattr(notification.data, 'error'):
reason = notification.data.error reason = notification.data.error
elif hasattr(notification.data, 'reason'): elif hasattr(notification.data, 'reason'):
reason = notification.data.reason reason = notification.data.reason
self.accounts[position].registration_state = 'failed (%s)' % (reason.decode() if isinstance(reason, bytes) else reason) self.accounts[position].registration_state = 'failed (%s)' % (reason.decode() if isinstance(reason, bytes) else reason)
self.accounts[position].registrar = None self.accounts[position].registrar = None
self.dataChanged.emit(self.index(position), self.index(position)) self.dataChanged.emit(self.index(position), self.index(position))
...@@ -519,7 +519,7 @@ class AddAccountDialog(base_class, ui_class, metaclass=QSingleton): ...@@ -519,7 +519,7 @@ class AddAccountDialog(base_class, ui_class, metaclass=QSingleton):
else: else:
if ca not in existing_cas: if ca not in existing_cas:
certificate_file = open(ca_path, 'w') certificate_file = open(ca_path, 'w')
certificate_file.write(existing_cas+ca) certificate_file.write(existing_cas + ca)
certificate_file.close() certificate_file.close()
settings = SIPSimpleSettings() settings = SIPSimpleSettings()
settings.tls.ca_list = ca_path settings.tls.ca_list = ca_path
...@@ -551,6 +551,7 @@ class AddAccountDialog(base_class, ui_class, metaclass=QSingleton): ...@@ -551,6 +551,7 @@ class AddAccountDialog(base_class, ui_class, metaclass=QSingleton):
self._initialize() self._initialize()
self.show() self.show()
del ui_class, base_class del ui_class, base_class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment