From 7f7ac0f20df05041a965b68fd99f5c3d06c87549 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 27 Feb 2020 21:48:45 +0000 Subject: [PATCH] Two broken functions found in testing. --- openlp/core/common/__init__.py | 2 +- openlp/core/common/settings.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openlp/core/common/__init__.py b/openlp/core/common/__init__.py index 6f8ed2025..543386e84 100644 --- a/openlp/core/common/__init__.py +++ b/openlp/core/common/__init__.py @@ -57,7 +57,7 @@ REPLACMENT_CHARS_MAP = str.maketrans({'\u2018': '\'', '\u2019': '\'', '\u201c': '\u2013': '-', '\u2014': '-', '\v': '\n\n', '\f': '\n\n'}) NEW_LINE_REGEX = re.compile(r' ?(\r\n?|\n) ?') WHITESPACE_REGEX = re.compile(r'[ \t]+') -INTERFACE_FILTER = re.compile('lo|loopback|docker|tun', re.IGNORECASE) +INTERFACE_FILTER = re.compile('^lo|loopback|docker|tun', re.IGNORECASE) def get_network_interfaces(): diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 83d063cc0..e36ada28f 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -679,7 +679,11 @@ class Settings(QtCore.QSettings): default_value = Settings.__default_settings__[self.group() + '/' + key] else: default_value = Settings.__default_settings__[key] - setting = super(Settings, self).value(key, default_value) + try: + setting = super(Settings, self).value(key, default_value) + except TypeError: + log.error(f'Setting {key} is invalid , default {default_value} used as replacement') + setting = default_value return self._convert_value(setting, default_value) def setValue(self, key, value):