From 4c1f67f84b4cb79eef8c5d240d80fc63c0765590 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 10 Jun 2019 22:10:38 +0200 Subject: [PATCH 1/6] Set song import/export default directory to None --- openlp/plugins/songs/songsplugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index a6fdcd99f..f9a1fd2f8 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -66,8 +66,8 @@ __default_settings__ = { 'songs/add song from service': True, 'songs/add songbook slide': False, 'songs/display songbar': True, - 'songs/last directory import': '', - 'songs/last directory export': '', + 'songs/last directory import': None, + 'songs/last directory export': None, 'songs/songselect username': '', 'songs/songselect password': '', 'songs/songselect searches': '', From 4361159434dddd17670df86ddeaee6ed7325df3d Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 10 Jun 2019 22:22:22 +0200 Subject: [PATCH 2/6] Set the default value of core/display_on_monitor to False to avoid blocking the screen with the display window on first start. --- openlp/core/common/settings.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 297e1d37f..f974d949b 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -130,9 +130,6 @@ class Settings(QtCore.QSettings): ``advanced/slide limits`` to ``SlideLimits.Wrap``. **NOTE**, this means that the rules have to cover all cases! So, if the type of the old value is bool, then there must be two rules. """ - on_monitor_default = True - if log.isEnabledFor(logging.DEBUG): - on_monitor_default = False __default_settings__ = { 'settings/version': 0, 'advanced/add page break': False, @@ -205,7 +202,7 @@ class Settings(QtCore.QSettings): 'core/view mode': 'default', # The other display settings (display position and dimensions) are defined in the ScreenList class due to a # circular dependency. - 'core/display on monitor': on_monitor_default, + 'core/display on monitor': False, 'core/override position': False, 'core/monitor': {}, 'core/application version': '0.0', From 4f705a649a5eca20f07647b95dff09194a1777cc Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 10 Jun 2019 22:44:24 +0200 Subject: [PATCH 3/6] Loading VLC module can also result in an OSError --- openlp/core/ui/media/vlcplayer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/media/vlcplayer.py b/openlp/core/ui/media/vlcplayer.py index 244916d24..055d599aa 100644 --- a/openlp/core/ui/media/vlcplayer.py +++ b/openlp/core/ui/media/vlcplayer.py @@ -65,7 +65,7 @@ def get_vlc(): if 'vlc' not in sys.modules: try: import vlc # noqa module is not used directly, but is used via sys.modules['vlc'] - except ImportError: + except (ImportError, OSError): return None # Verify that VLC is also loadable is_vlc_available = False From 9966d8ace7e662f9c2b7cc3687cf75d4ba734fea Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 11 Jun 2019 21:11:54 +0200 Subject: [PATCH 4/6] Missed a rename of _write_theme to save_theme. --- openlp/core/ui/thememanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 46d067970..4a3aa5073 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -173,7 +173,7 @@ class ThemeManager(QtWidgets.QWidget, RegistryBase, Ui_ThemeManager, LogMixin, R for xml_file_path in xml_file_paths: theme_data = get_text_file_string(xml_file_path) theme = self._create_theme_from_xml(theme_data, self.theme_path) - self._write_theme(theme) + self.save_theme(theme) xml_file_path.unlink() def build_theme_path(self): From 7cb8758fdd4bd670408b36e563cbe7eb56b9a129 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 11 Jun 2019 21:12:33 +0200 Subject: [PATCH 5/6] Fixed test on windows by mocking out render. --- tests/openlp_core/ui/test_themeform.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/openlp_core/ui/test_themeform.py b/tests/openlp_core/ui/test_themeform.py index 02a7d0589..19a86457f 100644 --- a/tests/openlp_core/ui/test_themeform.py +++ b/tests/openlp_core/ui/test_themeform.py @@ -23,7 +23,7 @@ Interface tests to test the ThemeWizard class and related methods. """ from unittest import TestCase -from unittest.mock import patch +from unittest.mock import patch, MagicMock from openlp.core.common.registry import Registry from openlp.core.ui.themeform import ThemeForm @@ -39,6 +39,8 @@ class TestThemeManager(TestCase, TestMixin): Create the UI """ Registry.create() + mocked_renderer = MagicMock() + Registry().register('renderer', mocked_renderer) @patch('openlp.core.display.window.QtWidgets.QVBoxLayout') def test_create_theme_wizard(self, mocked_qvboxlayout): From 626d75ff1ace6d9d843dff2b231f5c08f09d1a9a Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 11 Jun 2019 21:27:17 +0200 Subject: [PATCH 6/6] Added Pyro4 to appveyor to make the latest tests run. --- scripts/appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/appveyor.yml b/scripts/appveyor.yml index 76e305b4e..3e0e0ce3a 100644 --- a/scripts/appveyor.yml +++ b/scripts/appveyor.yml @@ -18,7 +18,7 @@ environment: install: # Install dependencies from pypi - - "%PYTHON%\\python.exe -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock pyodbc psycopg2 pypiwin32 websockets asyncio waitress six webob requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc" + - "%PYTHON%\\python.exe -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock pyodbc psycopg2 pypiwin32 websockets asyncio waitress six webob requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc Pyro4" build: off