forked from openlp/openlp
fix pep8.5
This commit is contained in:
parent
b7bb59a837
commit
ae2109e509
@ -210,8 +210,8 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
# Generic controls
|
# Generic controls
|
||||||
controller.mediabar.setVisible(value)
|
controller.mediabar.setVisible(value)
|
||||||
#if controller.is_live and controller.display:
|
# if controller.is_live and controller.display:
|
||||||
#if self.current_media_players and value:
|
# if self.current_media_players and value:
|
||||||
# controller.display.set_transparency(False)
|
# controller.display.set_transparency(False)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -286,7 +286,7 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties):
|
|||||||
return False
|
return False
|
||||||
log.debug('video media type: ' + str(controller.media_info.media_type))
|
log.debug('video media type: ' + str(controller.media_info.media_type))
|
||||||
# dont care about actual theme, set a black background
|
# 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");')
|
# display.frame.runJavaScript('show_video("setBackBoard", null, null,"visible");')
|
||||||
# now start playing - Preview is autoplay!
|
# now start playing - Preview is autoplay!
|
||||||
autoplay = False
|
autoplay = False
|
||||||
@ -550,7 +550,7 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
display = self._define_display(controller)
|
display = self._define_display(controller)
|
||||||
if controller.controller_type in self.current_media_players:
|
if controller.controller_type in self.current_media_players:
|
||||||
#if not looping_background:
|
# if not looping_background:
|
||||||
# display.frame.runJavaScript('show_blank("black");')
|
# display.frame.runJavaScript('show_blank("black");')
|
||||||
self.current_media_players[controller.controller_type].stop(display)
|
self.current_media_players[controller.controller_type].stop(display)
|
||||||
self.current_media_players[controller.controller_type].set_visible(display, False)
|
self.current_media_players[controller.controller_type].set_visible(display, False)
|
||||||
|
@ -22,13 +22,11 @@
|
|||||||
"""
|
"""
|
||||||
The :mod:`~openlp.core.ui.media.playertab` module holds the configuration tab for the media stuff.
|
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 import is_linux, is_win
|
||||||
from openlp.core.common.i18n import UiStrings, translate
|
from openlp.core.common.i18n import translate
|
||||||
from openlp.core.common.registry import Registry
|
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
from openlp.core.lib.settingstab import SettingsTab
|
from openlp.core.lib.settingstab import SettingsTab
|
||||||
from openlp.core.ui.icons import UiIcons
|
from openlp.core.ui.icons import UiIcons
|
||||||
|
@ -373,7 +373,7 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
assert mocked_vlc_media == mocked_display.vlc_media
|
assert mocked_vlc_media == mocked_display.vlc_media
|
||||||
mocked_display.vlc_media_player.set_media.assert_called_with(mocked_vlc_media)
|
mocked_display.vlc_media_player.set_media.assert_called_with(mocked_vlc_media)
|
||||||
mocked_vlc_media.parse.assert_called_with()
|
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
|
assert result is True
|
||||||
|
|
||||||
@patch('openlp.core.ui.media.vlcplayer.is_win')
|
@patch('openlp.core.ui.media.vlcplayer.is_win')
|
||||||
@ -962,15 +962,13 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
vlc_player = VlcPlayer(None)
|
vlc_player = VlcPlayer(None)
|
||||||
|
|
||||||
# WHEN: update_ui() is called
|
# WHEN: update_ui() is called
|
||||||
with patch.object(vlc_player, 'stop') as mocked_stop, \
|
with patch.object(vlc_player, 'stop') as mocked_stop:
|
||||||
patch.object(vlc_player, 'set_visible') as mocked_set_visible:
|
|
||||||
vlc_player.update_ui(mocked_controller, mocked_display)
|
vlc_player.update_ui(mocked_controller, mocked_display)
|
||||||
|
|
||||||
# THEN: Certain methods should be called
|
# THEN: Certain methods should be called
|
||||||
mocked_stop.assert_called_with(mocked_display)
|
mocked_stop.assert_called_with(mocked_display)
|
||||||
assert 1 == mocked_stop.call_count
|
assert 1 == mocked_stop.call_count
|
||||||
mocked_display.vlc_media_player.get_time.assert_called_with()
|
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)
|
mocked_controller.seek_slider.setSliderPosition.assert_called_with(300)
|
||||||
expected_calls = [call(True), call(False)]
|
expected_calls = [call(True), call(False)]
|
||||||
assert expected_calls == mocked_controller.seek_slider.blockSignals.call_args_list
|
assert expected_calls == mocked_controller.seek_slider.blockSignals.call_args_list
|
||||||
|
Loading…
Reference in New Issue
Block a user