From 582e2e267a291a18609a108a6b5fbd7095ff55fa Mon Sep 17 00:00:00 2001 From: Phill Ridout Date: Sat, 2 Dec 2017 21:47:11 +0000 Subject: [PATCH] Minor fixes Fixes: https://launchpad.net/bugs/1735765 --- openlp/core/api/deploy.py | 2 ++ openlp/core/api/http/server.py | 5 ++++- openlp/core/app.py | 4 ++-- openlp/core/common/settings.py | 2 +- openlp/core/ui/servicemanager.py | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/openlp/core/api/deploy.py b/openlp/core/api/deploy.py index b64cc40d5..a42f83f0c 100644 --- a/openlp/core/api/deploy.py +++ b/openlp/core/api/deploy.py @@ -52,6 +52,8 @@ def download_sha256(): web_config = get_web_page('https://get.openlp.org/webclient/download.cfg', headers={'User-Agent': user_agent}) except ConnectionError: return False + if not web_config: + return None file_bits = web_config.split() return file_bits[0], file_bits[2] diff --git a/openlp/core/api/http/server.py b/openlp/core/api/http/server.py index b17888ddb..c80275801 100644 --- a/openlp/core/api/http/server.py +++ b/openlp/core/api/http/server.py @@ -67,7 +67,10 @@ class HttpWorker(QtCore.QObject): address = Settings().value('api/ip address') port = Settings().value('api/port') Registry().execute('get_website_version') - serve(application, host=address, port=port) + try: + serve(application, host=address, port=port) + except OSError: + log.exception('An error occurred when serving the application.') def stop(self): pass diff --git a/openlp/core/app.py b/openlp/core/app.py index 19943e3f0..114a62807 100644 --- a/openlp/core/app.py +++ b/openlp/core/app.py @@ -403,8 +403,8 @@ def main(args=None): .format(back_up_path=back_up_path)) QtWidgets.QMessageBox.information( None, translate('OpenLP', 'Settings Upgrade'), - translate('OpenLP', 'Your settings are about to upgraded. A backup will be created at {back_up_path}') - .format(back_up_path=back_up_path)) + translate('OpenLP', 'Your settings are about to be upgraded. A backup will be created at ' + '{back_up_path}').format(back_up_path=back_up_path)) settings.export(back_up_path) settings.upgrade_settings() # First time checks in settings diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 225feb4e1..54f1d9b2a 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -236,7 +236,7 @@ class Settings(QtCore.QSettings): ('bibles/last search type', '', []), ('custom/last search type', 'custom/last used search type', []), # The following changes are being made for the conversion to using Path objects made in 2.6 development - ('advanced/data path', 'advanced/data path', [(str_to_path, None)]), + ('advanced/data path', 'advanced/data path', [(lambda p: Path(p) if p is not None else None, None)]), ('crashreport/last directory', 'crashreport/last directory', [(str_to_path, None)]), ('servicemanager/last directory', 'servicemanager/last directory', [(str_to_path, None)]), ('servicemanager/last file', 'servicemanager/last file', [(str_to_path, None)]), diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 76d696ba0..29718e09a 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -389,7 +389,8 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi """ Return the current file name, excluding the path. """ - return self._service_path.name + if self._service_path: + return self._service_path.name def reset_supported_suffixes(self): """