From ae2109e50984fad5452180cc5ff120ef9de7a6a3 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 27 Mar 2019 18:59:03 +0000 Subject: [PATCH] fix pep8.5 --- openlp/core/ui/media/mediacontroller.py | 8 ++++---- openlp/core/ui/media/mediatab.py | 6 ++---- tests/functional/openlp_core/ui/media/test_vlcplayer.py | 6 ++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 6df92cd14..70ac9faf3 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -210,8 +210,8 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties): """ # Generic controls controller.mediabar.setVisible(value) - #if controller.is_live and controller.display: - #if self.current_media_players and value: + # if controller.is_live and controller.display: + # if self.current_media_players and value: # controller.display.set_transparency(False) @staticmethod @@ -286,7 +286,7 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties): return False log.debug('video media type: ' + str(controller.media_info.media_type)) # dont care about actual theme, set a black background - #if controller.is_live and not controller.media_info.is_background: + # if controller.is_live and not controller.media_info.is_background: # display.frame.runJavaScript('show_video("setBackBoard", null, null,"visible");') # now start playing - Preview is autoplay! autoplay = False @@ -550,7 +550,7 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties): """ display = self._define_display(controller) if controller.controller_type in self.current_media_players: - #if not looping_background: + # if not looping_background: # display.frame.runJavaScript('show_blank("black");') self.current_media_players[controller.controller_type].stop(display) self.current_media_players[controller.controller_type].set_visible(display, False) diff --git a/openlp/core/ui/media/mediatab.py b/openlp/core/ui/media/mediatab.py index 9dfeb7abd..a6b1a6ec0 100644 --- a/openlp/core/ui/media/mediatab.py +++ b/openlp/core/ui/media/mediatab.py @@ -22,13 +22,11 @@ """ The :mod:`~openlp.core.ui.media.playertab` module holds the configuration tab for the media stuff. """ -import platform -from PyQt5 import QtCore, QtWidgets +from PyQt5 import QtWidgets from openlp.core.common import is_linux, is_win -from openlp.core.common.i18n import UiStrings, translate -from openlp.core.common.registry import Registry +from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings from openlp.core.lib.settingstab import SettingsTab from openlp.core.ui.icons import UiIcons diff --git a/tests/functional/openlp_core/ui/media/test_vlcplayer.py b/tests/functional/openlp_core/ui/media/test_vlcplayer.py index 44617e7bc..1ae05da52 100644 --- a/tests/functional/openlp_core/ui/media/test_vlcplayer.py +++ b/tests/functional/openlp_core/ui/media/test_vlcplayer.py @@ -373,7 +373,7 @@ class TestVLCPlayer(TestCase, TestMixin): assert mocked_vlc_media == mocked_display.vlc_media mocked_display.vlc_media_player.set_media.assert_called_with(mocked_vlc_media) mocked_vlc_media.parse.assert_called_with() - # mocked_volume.assert_called_with(mocked_display, 100) + mocked_volume.assert_called_with(mocked_display, 100) assert result is True @patch('openlp.core.ui.media.vlcplayer.is_win') @@ -962,15 +962,13 @@ class TestVLCPlayer(TestCase, TestMixin): vlc_player = VlcPlayer(None) # WHEN: update_ui() is called - with patch.object(vlc_player, 'stop') as mocked_stop, \ - patch.object(vlc_player, 'set_visible') as mocked_set_visible: + with patch.object(vlc_player, 'stop') as mocked_stop: vlc_player.update_ui(mocked_controller, mocked_display) # THEN: Certain methods should be called mocked_stop.assert_called_with(mocked_display) assert 1 == mocked_stop.call_count mocked_display.vlc_media_player.get_time.assert_called_with() - # mocked_set_visible.assert_called_with(mocked_display, False) mocked_controller.seek_slider.setSliderPosition.assert_called_with(300) expected_calls = [call(True), call(False)] assert expected_calls == mocked_controller.seek_slider.blockSignals.call_args_list