fix pep8.5

This commit is contained in:
Tim Bentley 2019-03-27 18:59:03 +00:00
parent b7bb59a837
commit ae2109e509
3 changed files with 8 additions and 12 deletions

View File

@ -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)

View File

@ -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

View File

@ -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