← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~tomasgroth/openlp/fixes-201906-a into lp:openlp

 

Tomas Groth has proposed merging lp:~tomasgroth/openlp/fixes-201906-a into lp:openlp.

Commit message:
Added Pyro4 to appveyor to make the latest tests run.
Fixed test on windows by mocking out render.
Missed a rename of _write_theme to save_theme.
Loading VLC module can also result in an OSError
Set the default value of core/display_on_monitor to False to avoid blocking the screen with the display window on first start.
Set song import/export default directory to None
Add a webengine view for previewing themes. Made VLC loading more robust. A few minor fixes.


Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~tomasgroth/openlp/fixes-201906-a/+merge/368677
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~tomasgroth/openlp/fixes-201906-a into lp:openlp.
=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2019-05-22 20:46:51 +0000
+++ openlp/core/common/settings.py	2019-06-11 19:31:11 +0000
@@ -130,9 +130,6 @@
         ``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 @@
         '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',

=== modified file 'openlp/core/ui/media/vlcplayer.py'
--- openlp/core/ui/media/vlcplayer.py	2019-06-11 05:01:02 +0000
+++ openlp/core/ui/media/vlcplayer.py	2019-06-11 19:31:11 +0000
@@ -65,7 +65,7 @@
     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

=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2019-06-07 21:05:02 +0000
+++ openlp/core/ui/thememanager.py	2019-06-11 19:31:11 +0000
@@ -173,7 +173,7 @@
         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):

=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py	2019-05-22 06:47:00 +0000
+++ openlp/plugins/songs/songsplugin.py	2019-06-11 19:31:11 +0000
@@ -66,8 +66,8 @@
     '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': '',

=== modified file 'scripts/appveyor.yml'
--- scripts/appveyor.yml	2019-05-23 20:29:04 +0000
+++ scripts/appveyor.yml	2019-06-11 19:31:11 +0000
@@ -18,7 +18,7 @@
 
 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
 

=== modified file 'tests/openlp_core/ui/test_themeform.py'
--- tests/openlp_core/ui/test_themeform.py	2019-06-09 20:06:20 +0000
+++ tests/openlp_core/ui/test_themeform.py	2019-06-11 19:31:11 +0000
@@ -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 @@
         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):


Follow ups