Commit 98cc0d5a authored by Tijmen de Mes's avatar Tijmen de Mes

Syntax fixes

parent 466278c1
...@@ -214,4 +214,3 @@ class Blink(QApplication, metaclass=QSingleton): ...@@ -214,4 +214,3 @@ class Blink(QApplication, metaclass=QSingleton):
log.error('Fatal error:\n{}'.format(notification.data.traceback)) log.error('Fatal error:\n{}'.format(notification.data.traceback))
QMessageBox.critical(self.main_window, "Fatal Error", "A fatal error occurred, {} will now exit.".format(self.applicationName())) QMessageBox.critical(self.main_window, "Fatal Error", "A fatal error occurred, {} will now exit.".format(self.applicationName()))
sys.exit(1) sys.exit(1)
...@@ -2641,5 +2641,3 @@ class VideoScreenshot(object): ...@@ -2641,5 +2641,3 @@ class VideoScreenshot(object):
filename = next(filename for filename in self.filename_generator() if not os.path.exists(filename)) filename = next(filename for filename in self.filename_generator() if not os.path.exists(filename))
makedirs(os.path.dirname(filename)) makedirs(os.path.dirname(filename))
self.image.save(filename) self.image.save(filename)
...@@ -65,7 +65,6 @@ class SoundSettings(SettingsGroup): ...@@ -65,7 +65,6 @@ class SoundSettings(SettingsGroup):
inbound_ringtone = Setting(type=SoundFile, default=None, nillable=True) inbound_ringtone = Setting(type=SoundFile, default=None, nillable=True)
class XCAPSettingsExtension(XCAPSettings): class XCAPSettingsExtension(XCAPSettings):
enabled = Setting(type=bool, default=True) enabled = Setting(type=bool, default=True)
icon = RuntimeSetting(type=IconDescriptor, nillable=True, default=None) icon = RuntimeSetting(type=IconDescriptor, nillable=True, default=None)
......
...@@ -36,7 +36,7 @@ class HistoryManager(object, metaclass=Singleton): ...@@ -36,7 +36,7 @@ class HistoryManager(object, metaclass=Singleton):
if not isinstance(data, list) or not all(isinstance(item, HistoryEntry) and item.text and isinstance(item.call_time, ISOTimestamp) for item in data): if not isinstance(data, list) or not all(isinstance(item, HistoryEntry) and item.text and isinstance(item.call_time, ISOTimestamp) for item in data):
raise ValueError("invalid save data") raise ValueError("invalid save data")
except Exception as e: except Exception as e:
traceback.print_exc() traceback.print_exc()
self.calls = [] self.calls = []
else: else:
self.calls = data[-self.history_size:] self.calls = data[-self.history_size:]
...@@ -68,7 +68,7 @@ class HistoryManager(object, metaclass=Singleton): ...@@ -68,7 +68,7 @@ class HistoryManager(object, metaclass=Singleton):
return return
session = notification.sender session = notification.sender
entry = HistoryEntry.from_session(session) entry = HistoryEntry.from_session(session)
if session.direction == 'incoming': if session.direction == 'incoming':
if notification.data.code != 487 or notification.data.failure_reason != 'Call completed elsewhere': if notification.data.code != 487 or notification.data.failure_reason != 'Call completed elsewhere':
entry.failed = True entry.failed = True
...@@ -192,7 +192,7 @@ class HistoryEntry(object): ...@@ -192,7 +192,7 @@ class HistoryEntry(object):
user = user.decode() if isinstance(user, bytes) else user user = user.decode() if isinstance(user, bytes) else user
domain = domain.decode() if isinstance(domain, bytes) else domain domain = domain.decode() if isinstance(domain, bytes) else domain
remote_uri = '%s@%s' % (user, domain) remote_uri = '%s@%s' % (user, domain)
match = cls.phone_number_re.match(remote_uri) match = cls.phone_number_re.match(remote_uri)
if match: if match:
......
...@@ -930,6 +930,7 @@ class MainWindow(base_class, ui_class): ...@@ -930,6 +930,7 @@ class MainWindow(base_class, ui_class):
self.pending_watcher_dialogs.append(dialog) self.pending_watcher_dialogs.append(dialog)
dialog.show() dialog.show()
def _NH_BlinkSessionNewOutgoing(self, notification): def _NH_BlinkSessionNewOutgoing(self, notification):
self.search_box.clear() self.search_box.clear()
......
...@@ -459,7 +459,6 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton): ...@@ -459,7 +459,6 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self.idd_prefix_label.setMinimumWidth(text_width) self.idd_prefix_label.setMinimumWidth(text_width)
self.tls_cert_file_label.setMinimumWidth(text_width) self.tls_cert_file_label.setMinimumWidth(text_width)
# audio settings # audio settings
font_metrics = self.answer_delay_label.fontMetrics() # we assume all labels have the same font font_metrics = self.answer_delay_label.fontMetrics() # we assume all labels have the same font
labels = (self.audio_input_device_label, self.audio_output_device_label, self.audio_alert_device_label, self.audio_sample_rate_label, labels = (self.audio_input_device_label, self.audio_output_device_label, self.audio_alert_device_label, self.audio_sample_rate_label,
......
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