From 9b731aad7a0f93ba6e83cb9f75da0e27328f0e83 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Thu, 27 Nov 2014 21:40:56 +0000 Subject: [PATCH 01/12] Fix projector tests on windows --- tests/functional/openlp_core_lib/test_projectordb.py | 2 +- tests/interfaces/openlp_core_ui/test_projectormanager.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_projectordb.py b/tests/functional/openlp_core_lib/test_projectordb.py index ba79b59c3..ecb78b3ef 100644 --- a/tests/functional/openlp_core_lib/test_projectordb.py +++ b/tests/functional/openlp_core_lib/test_projectordb.py @@ -85,7 +85,7 @@ class TestProjectorDB(TestCase): Set up anything necessary for all tests """ if not hasattr(self, 'projector'): - with patch('openlp.core.lib.projector.db.init_url') as mocked_init_url: + with patch('openlp.core.lib.db.init_url') as mocked_init_url: mocked_init_url.start() mocked_init_url.return_value = 'sqlite:///%s' % tmpfile self.projector = ProjectorDB() diff --git a/tests/interfaces/openlp_core_ui/test_projectormanager.py b/tests/interfaces/openlp_core_ui/test_projectormanager.py index a46b0b93c..f21171fb5 100644 --- a/tests/interfaces/openlp_core_ui/test_projectormanager.py +++ b/tests/interfaces/openlp_core_ui/test_projectormanager.py @@ -57,8 +57,8 @@ class TestProjectorManager(TestCase, TestMixin): self.setup_application() Registry.create() if not hasattr(self, 'projector_manager'): - with patch('openlp.core.lib.projector.db.init_url') as mocked_init_url: - mocked_init_url.start() + with patch('openlp.core.lib.db.init_url') as mocked_init_url: + #mocked_init_url.start() mocked_init_url.return_value = 'sqlite:///%s' % tmpfile self.projectordb = ProjectorDB() if not hasattr(self, 'projector_manager'): From 01cbd921e9618404e1e0560533ebdc89ae48439e Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 28 Nov 2014 08:13:21 +0000 Subject: [PATCH 02/12] Open opensong files in 'rb' mode. Fixes bug 1396958 Fixes: https://launchpad.net/bugs/1396958 --- openlp/plugins/songs/lib/importers/opensong.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/importers/opensong.py b/openlp/plugins/songs/lib/importers/opensong.py index e1502a903..96e35e4f5 100644 --- a/openlp/plugins/songs/lib/importers/opensong.py +++ b/openlp/plugins/songs/lib/importers/opensong.py @@ -126,7 +126,7 @@ class OpenSongImport(SongImport): for filename in self.import_source: if self.stop_import_flag: return - song_file = open(filename) + song_file = open(filename, 'rb') self.do_import_file(song_file) song_file.close() From 7d51352b2d1b48e9f7721c0470e457aaec8052c8 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 28 Nov 2014 08:15:59 +0000 Subject: [PATCH 03/12] Added divx and xvid as supported files for VLC. Fixes bug 1215302 Fixes: https://launchpad.net/bugs/1215302 --- openlp/core/ui/media/vlcplayer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/media/vlcplayer.py b/openlp/core/ui/media/vlcplayer.py index 04afeb034..7abf2eac2 100644 --- a/openlp/core/ui/media/vlcplayer.py +++ b/openlp/core/ui/media/vlcplayer.py @@ -77,6 +77,7 @@ VIDEO_EXT = [ '*.asf', '*.wmv', '*.au', '*.avi', + '*.divx', '*.flv', '*.mov', '*.mp4', '*.m4v', @@ -95,7 +96,8 @@ VIDEO_EXT = [ '*.xa', '*.iso', '*.vob', - '*.webm' + '*.webm', + '*.xvid' ] From 9c64bd9d5621f3eabd07ad298f07efe91e6a7afb Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 28 Nov 2014 08:21:03 +0000 Subject: [PATCH 04/12] Added pptm as support file format for Powerpoint, Powerpoint Viewer and Libre/OpenOffice Impress. Fixes bug 1088800. Fixes: https://launchpad.net/bugs/1088800 --- openlp/plugins/presentations/lib/impresscontroller.py | 2 +- openlp/plugins/presentations/lib/powerpointcontroller.py | 2 +- openlp/plugins/presentations/lib/pptviewcontroller.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index a6e52411b..1375fb8fa 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -85,7 +85,7 @@ class ImpressController(PresentationController): log.debug('Initialising') super(ImpressController, self).__init__(plugin, 'Impress', ImpressDocument) self.supports = ['odp'] - self.also_supports = ['ppt', 'pps', 'pptx', 'ppsx'] + self.also_supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm'] self.process = None self.desktop = None self.manager = None diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index cf0f5bb99..194bbacb2 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -64,7 +64,7 @@ class PowerpointController(PresentationController): """ log.debug('Initialising') super(PowerpointController, self).__init__(plugin, 'Powerpoint', PowerpointDocument) - self.supports = ['ppt', 'pps', 'pptx', 'ppsx'] + self.supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm'] self.process = None def check_available(self): diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 8bde0b213..42e034107 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -63,7 +63,7 @@ class PptviewController(PresentationController): log.debug('Initialising') self.process = None super(PptviewController, self).__init__(plugin, 'Powerpoint Viewer', PptviewDocument) - self.supports = ['ppt', 'pps', 'pptx', 'ppsx'] + self.supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm'] def check_available(self): """ From 612041daface397d71cb6495c2d7fa3bdf300c88 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 28 Nov 2014 08:26:33 +0000 Subject: [PATCH 05/12] Remove unnecessary start of patch in test --- tests/functional/openlp_core_lib/test_projectordb.py | 1 - tests/interfaces/openlp_core_ui/test_projectormanager.py | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_projectordb.py b/tests/functional/openlp_core_lib/test_projectordb.py index ecb78b3ef..d92258ff9 100644 --- a/tests/functional/openlp_core_lib/test_projectordb.py +++ b/tests/functional/openlp_core_lib/test_projectordb.py @@ -86,7 +86,6 @@ class TestProjectorDB(TestCase): """ if not hasattr(self, 'projector'): with patch('openlp.core.lib.db.init_url') as mocked_init_url: - mocked_init_url.start() mocked_init_url.return_value = 'sqlite:///%s' % tmpfile self.projector = ProjectorDB() diff --git a/tests/interfaces/openlp_core_ui/test_projectormanager.py b/tests/interfaces/openlp_core_ui/test_projectormanager.py index f21171fb5..9ecbaca38 100644 --- a/tests/interfaces/openlp_core_ui/test_projectormanager.py +++ b/tests/interfaces/openlp_core_ui/test_projectormanager.py @@ -58,7 +58,6 @@ class TestProjectorManager(TestCase, TestMixin): Registry.create() if not hasattr(self, 'projector_manager'): with patch('openlp.core.lib.db.init_url') as mocked_init_url: - #mocked_init_url.start() mocked_init_url.return_value = 'sqlite:///%s' % tmpfile self.projectordb = ProjectorDB() if not hasattr(self, 'projector_manager'): From 6af0aef8bd659d1ad64a58ef48a340ce45148eee Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 28 Nov 2014 10:53:39 +0000 Subject: [PATCH 06/12] Another attempt to fix projector test across platforms and versions --- tests/functional/openlp_core_lib/test_projectordb.py | 7 +++++-- tests/interfaces/openlp_core_ui/test_projectormanager.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_projectordb.py b/tests/functional/openlp_core_lib/test_projectordb.py index d92258ff9..4dd5f52a3 100644 --- a/tests/functional/openlp_core_lib/test_projectordb.py +++ b/tests/functional/openlp_core_lib/test_projectordb.py @@ -85,8 +85,11 @@ class TestProjectorDB(TestCase): Set up anything necessary for all tests """ if not hasattr(self, 'projector'): - with patch('openlp.core.lib.db.init_url') as mocked_init_url: - mocked_init_url.return_value = 'sqlite:///%s' % tmpfile + # We need to patch this twice to make it work across multiple platforms and versions. + with patch('openlp.core.lib.db.init_url') as mocked_init_url1, \ + patch('openlp.core.lib.projector.db.init_url') as mocked_init_url2: + mocked_init_url1.return_value = 'sqlite:///%s' % tmpfile + mocked_init_url2.return_value = 'sqlite:///%s' % tmpfile self.projector = ProjectorDB() def find_record_by_ip_test(self): diff --git a/tests/interfaces/openlp_core_ui/test_projectormanager.py b/tests/interfaces/openlp_core_ui/test_projectormanager.py index 9ecbaca38..edfaa9a62 100644 --- a/tests/interfaces/openlp_core_ui/test_projectormanager.py +++ b/tests/interfaces/openlp_core_ui/test_projectormanager.py @@ -57,8 +57,11 @@ class TestProjectorManager(TestCase, TestMixin): self.setup_application() Registry.create() if not hasattr(self, 'projector_manager'): - with patch('openlp.core.lib.db.init_url') as mocked_init_url: - mocked_init_url.return_value = 'sqlite:///%s' % tmpfile + # We need to patch this twice to make it work across multiple platforms and versions. + with patch('openlp.core.lib.db.init_url') as mocked_init_url1, \ + patch('openlp.core.lib.projector.db.init_url') as mocked_init_url2: + mocked_init_url1.return_value = 'sqlite:///%s' % tmpfile + mocked_init_url2.return_value = 'sqlite:///%s' % tmpfile self.projectordb = ProjectorDB() if not hasattr(self, 'projector_manager'): self.projector_manager = ProjectorManager(projectordb=self.projectordb) From 7d2f2d147c586f147e5346f35726563ec12e72c6 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 1 Dec 2014 08:22:17 +0000 Subject: [PATCH 07/12] Another projector test fix attempt --- .../openlp_core_lib/test_projectordb.py | 16 +++++++++------- .../openlp_core_ui/test_projectormanager.py | 19 +++++++++++-------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_projectordb.py b/tests/functional/openlp_core_lib/test_projectordb.py index 4dd5f52a3..a1de8807f 100644 --- a/tests/functional/openlp_core_lib/test_projectordb.py +++ b/tests/functional/openlp_core_lib/test_projectordb.py @@ -32,7 +32,7 @@ record functions. PREREQUISITE: add_record() and get_all() functions validated. """ - +import sys from unittest import TestCase from tests.functional import MagicMock, patch @@ -85,12 +85,14 @@ class TestProjectorDB(TestCase): Set up anything necessary for all tests """ if not hasattr(self, 'projector'): - # We need to patch this twice to make it work across multiple platforms and versions. - with patch('openlp.core.lib.db.init_url') as mocked_init_url1, \ - patch('openlp.core.lib.projector.db.init_url') as mocked_init_url2: - mocked_init_url1.return_value = 'sqlite:///%s' % tmpfile - mocked_init_url2.return_value = 'sqlite:///%s' % tmpfile - self.projector = ProjectorDB() + # We need to patch this in different ways to make to work an all versions + if sys.version_info > (3, 4, 0): + mocked_init_url = patch('openlp.core.lib.db.init_url') + else: + mocked_init_url = patch('openlp.core.lib.projector.db.init_url') + mocked_init_url.start() + mocked_init_url.return_value = 'sqlite:///%s' % tmpfile + self.projector = ProjectorDB() def find_record_by_ip_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_projectormanager.py b/tests/interfaces/openlp_core_ui/test_projectormanager.py index edfaa9a62..52587a44b 100644 --- a/tests/interfaces/openlp_core_ui/test_projectormanager.py +++ b/tests/interfaces/openlp_core_ui/test_projectormanager.py @@ -31,6 +31,7 @@ Interface tests to test the themeManager class and related methods. """ import os +import sys from unittest import TestCase from openlp.core.common import Registry, Settings @@ -57,14 +58,16 @@ class TestProjectorManager(TestCase, TestMixin): self.setup_application() Registry.create() if not hasattr(self, 'projector_manager'): - # We need to patch this twice to make it work across multiple platforms and versions. - with patch('openlp.core.lib.db.init_url') as mocked_init_url1, \ - patch('openlp.core.lib.projector.db.init_url') as mocked_init_url2: - mocked_init_url1.return_value = 'sqlite:///%s' % tmpfile - mocked_init_url2.return_value = 'sqlite:///%s' % tmpfile - self.projectordb = ProjectorDB() - if not hasattr(self, 'projector_manager'): - self.projector_manager = ProjectorManager(projectordb=self.projectordb) + # We need to patch this in different ways to make to work an all versions + if sys.version_info > (3, 4, 0): + mocked_init_url = patch('openlp.core.lib.db.init_url') + else: + mocked_init_url = patch('openlp.core.lib.projector.db.init_url') + mocked_init_url.start() + mocked_init_url.return_value = 'sqlite:///%s' % tmpfile + self.projectordb = ProjectorDB() + if not hasattr(self, 'projector_manager'): + self.projector_manager = ProjectorManager(projectordb=self.projectordb) def tearDown(self): """ From e9410de13c1602c74a911b69bd5659b05a946520 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 1 Dec 2014 08:33:16 +0000 Subject: [PATCH 08/12] Revert attempted fixes to projector tests. Just don't use windows... --- .../openlp_core_lib/test_projectordb.py | 14 +++++--------- .../openlp_core_ui/test_projectormanager.py | 17 ++++++----------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_projectordb.py b/tests/functional/openlp_core_lib/test_projectordb.py index a1de8807f..ba79b59c3 100644 --- a/tests/functional/openlp_core_lib/test_projectordb.py +++ b/tests/functional/openlp_core_lib/test_projectordb.py @@ -32,7 +32,7 @@ record functions. PREREQUISITE: add_record() and get_all() functions validated. """ -import sys + from unittest import TestCase from tests.functional import MagicMock, patch @@ -85,14 +85,10 @@ class TestProjectorDB(TestCase): Set up anything necessary for all tests """ if not hasattr(self, 'projector'): - # We need to patch this in different ways to make to work an all versions - if sys.version_info > (3, 4, 0): - mocked_init_url = patch('openlp.core.lib.db.init_url') - else: - mocked_init_url = patch('openlp.core.lib.projector.db.init_url') - mocked_init_url.start() - mocked_init_url.return_value = 'sqlite:///%s' % tmpfile - self.projector = ProjectorDB() + with patch('openlp.core.lib.projector.db.init_url') as mocked_init_url: + mocked_init_url.start() + mocked_init_url.return_value = 'sqlite:///%s' % tmpfile + self.projector = ProjectorDB() def find_record_by_ip_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_projectormanager.py b/tests/interfaces/openlp_core_ui/test_projectormanager.py index 52587a44b..a46b0b93c 100644 --- a/tests/interfaces/openlp_core_ui/test_projectormanager.py +++ b/tests/interfaces/openlp_core_ui/test_projectormanager.py @@ -31,7 +31,6 @@ Interface tests to test the themeManager class and related methods. """ import os -import sys from unittest import TestCase from openlp.core.common import Registry, Settings @@ -58,16 +57,12 @@ class TestProjectorManager(TestCase, TestMixin): self.setup_application() Registry.create() if not hasattr(self, 'projector_manager'): - # We need to patch this in different ways to make to work an all versions - if sys.version_info > (3, 4, 0): - mocked_init_url = patch('openlp.core.lib.db.init_url') - else: - mocked_init_url = patch('openlp.core.lib.projector.db.init_url') - mocked_init_url.start() - mocked_init_url.return_value = 'sqlite:///%s' % tmpfile - self.projectordb = ProjectorDB() - if not hasattr(self, 'projector_manager'): - self.projector_manager = ProjectorManager(projectordb=self.projectordb) + with patch('openlp.core.lib.projector.db.init_url') as mocked_init_url: + mocked_init_url.start() + mocked_init_url.return_value = 'sqlite:///%s' % tmpfile + self.projectordb = ProjectorDB() + if not hasattr(self, 'projector_manager'): + self.projector_manager = ProjectorManager(projectordb=self.projectordb) def tearDown(self): """ From 1c71efc532f2464e897b3818f8a23d6bc94a8708 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 1 Dec 2014 15:08:13 +0000 Subject: [PATCH 09/12] Allow overwriting functions in registry, and use it when registring MainDisplay. Fixes bug 1397287 Fixes: https://launchpad.net/bugs/1397287 --- openlp/core/common/registry.py | 5 +++-- openlp/core/ui/maindisplay.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/openlp/core/common/registry.py b/openlp/core/common/registry.py index 218325823..70c2fe3bd 100644 --- a/openlp/core/common/registry.py +++ b/openlp/core/common/registry.py @@ -105,7 +105,7 @@ class Registry(object): if key in self.service_list: del self.service_list[key] - def register_function(self, event, function): + def register_function(self, event, function, overwrite=False): """ Register an event and associated function to be called @@ -113,8 +113,9 @@ class Registry(object): will/may need to respond to a single action and the caller does not need to understand or know about the recipients. :param function: The function to be called when the event happens. + :param overwrite: There should only be one function with the registred name. """ - if event in self.functions_list: + if not overwrite and event in self.functions_list: self.functions_list[event].append(function) else: self.functions_list[event] = [function] diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index f9f00a235..ceb94a2a9 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -153,9 +153,9 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.set_transparency(False) if self.is_live: - Registry().register_function('live_display_hide', self.hide_display) - Registry().register_function('live_display_show', self.show_display) - Registry().register_function('update_display_css', self.css_changed) + Registry().register_function('live_display_hide', self.hide_display, True) + Registry().register_function('live_display_show', self.show_display, True) + Registry().register_function('update_display_css', self.css_changed, True) def set_transparency(self, enabled): """ From af4715dc3c2a53c7f7a836c16377af7f894e0444 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 2 Dec 2014 09:46:19 +0000 Subject: [PATCH 10/12] Remove the registered functions instead of overwriting --- openlp/core/common/registry.py | 9 ++------- openlp/core/ui/maindisplay.py | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/openlp/core/common/registry.py b/openlp/core/common/registry.py index 70c2fe3bd..455c3385d 100644 --- a/openlp/core/common/registry.py +++ b/openlp/core/common/registry.py @@ -105,7 +105,7 @@ class Registry(object): if key in self.service_list: del self.service_list[key] - def register_function(self, event, function, overwrite=False): + def register_function(self, event, function): """ Register an event and associated function to be called @@ -113,9 +113,8 @@ class Registry(object): will/may need to respond to a single action and the caller does not need to understand or know about the recipients. :param function: The function to be called when the event happens. - :param overwrite: There should only be one function with the registred name. """ - if not overwrite and event in self.functions_list: + if event in self.functions_list: self.functions_list[event].append(function) else: self.functions_list[event] = [function] @@ -127,10 +126,6 @@ class Registry(object): :param event: The function description.. :param function: The function to be called when the event happens. """ - if not self.running_under_test: - trace_error_handler(log) - log.error('Invalid Method call for key %s' % event) - raise KeyError('Invalid Method call for key %s' % event) if event in self.functions_list: self.functions_list[event].remove(function) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index ceb94a2a9..d238a1f5e 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -153,9 +153,20 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.set_transparency(False) if self.is_live: - Registry().register_function('live_display_hide', self.hide_display, True) - Registry().register_function('live_display_show', self.show_display, True) - Registry().register_function('update_display_css', self.css_changed, True) + Registry().register_function('live_display_hide', self.hide_display) + Registry().register_function('live_display_show', self.show_display) + Registry().register_function('update_display_css', self.css_changed) + + def close(self): + """ + Remove registered function on close. + """ + if self.is_live: + Registry().remove_function('live_display_hide', self.hide_display) + Registry().remove_function('live_display_show', self.show_display) + Registry().remove_function('update_display_css', self.css_changed) + super().close() + def set_transparency(self, enabled): """ From 6ebc08d0d9df5d981b7308b891400b6f2f5d8487 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 2 Dec 2014 09:46:50 +0000 Subject: [PATCH 11/12] Attempt to fix crash in test --- .../openlp_core_ui/test_servicemanager.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/interfaces/openlp_core_ui/test_servicemanager.py b/tests/interfaces/openlp_core_ui/test_servicemanager.py index a08e4a1f1..2fe4c898e 100644 --- a/tests/interfaces/openlp_core_ui/test_servicemanager.py +++ b/tests/interfaces/openlp_core_ui/test_servicemanager.py @@ -49,7 +49,17 @@ class TestServiceManager(TestCase, TestMixin): self.setup_application() ScreenList.create(self.app.desktop()) Registry().register('application', MagicMock()) - with patch('openlp.core.lib.PluginManager'): + # Mock classes and methods used by mainwindow. + with patch('openlp.core.ui.mainwindow.SettingsForm') as mocked_settings_form, \ + patch('openlp.core.ui.mainwindow.ImageManager') as mocked_image_manager, \ + patch('openlp.core.ui.mainwindow.LiveController') as mocked_live_controller, \ + patch('openlp.core.ui.mainwindow.PreviewController') as mocked_preview_controller, \ + patch('openlp.core.ui.mainwindow.OpenLPDockWidget') as mocked_dock_widget, \ + patch('openlp.core.ui.mainwindow.QtGui.QToolBox') as mocked_q_tool_box_class, \ + patch('openlp.core.ui.mainwindow.QtGui.QMainWindow.addDockWidget') as mocked_add_dock_method, \ + patch('openlp.core.ui.mainwindow.ThemeManager') as mocked_theme_manager, \ + patch('openlp.core.ui.mainwindow.ProjectorManager') as mocked_projector_manager, \ + patch('openlp.core.ui.mainwindow.Renderer') as mocked_renderer: self.main_window = MainWindow() self.service_manager = Registry().get('service_manager') @@ -57,6 +67,7 @@ class TestServiceManager(TestCase, TestMixin): """ Delete all the C++ objects at the end so that we don't have a segfault """ + del self.main_window def basic_service_manager_test(self): """ From 20394de842d22eb3f67949237b3f9fb302902865 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 2 Dec 2014 10:02:13 +0000 Subject: [PATCH 12/12] pep8 fix --- openlp/core/ui/maindisplay.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index d238a1f5e..0d50e1d86 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -167,7 +167,6 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): Registry().remove_function('update_display_css', self.css_changed) super().close() - def set_transparency(self, enabled): """ Set the transparency of the window