From 392bfba0997f1e7e53b12023a5b3b6551f10b68a Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 4 Jan 2019 20:11:12 +0000 Subject: [PATCH] pep8 --- openlp/core/ui/maindisplay.py | 2 +- openlp/core/ui/media/mediacontroller.py | 2 +- openlp/core/ui/media/playertab.py | 16 ++++++++-------- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- scripts/jenkins_script.py | 2 +- tests/functional/openlp_core/test_state.py | 2 +- .../openlp_plugins/songs/test_mediaitem.py | 1 - .../interfaces/openlp_core/ui/test_mainwindow.py | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 57c87d588..1f96da434 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -30,7 +30,7 @@ Some of the code for this form is based on the examples at: import html import logging -from PyQt5 import QtCore, QtWidgets, QtWebKit, QtWebKitWidgets, QtGui, QtMultimedia +from PyQt5 import QtCore, QtWidgets, QtWebKit, QtWebKitWidgets, QtGui from openlp.core.common import is_macosx, is_win from openlp.core.common.applocation import AppLocation diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 83bd1be8d..a2c8bad0d 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -474,7 +474,7 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties): file = str(file) if suffix in player.video_extensions_list: if not controller.media_info.is_background or controller.media_info.is_background and \ - player.can_background: + player.can_background: self.resize(display, player) if player.load(display, file): self.current_media_players[controller.controller_type] = player diff --git a/openlp/core/ui/media/playertab.py b/openlp/core/ui/media/playertab.py index 5ba432e47..4bdba1008 100644 --- a/openlp/core/ui/media/playertab.py +++ b/openlp/core/ui/media/playertab.py @@ -201,7 +201,7 @@ class PlayerTab(SettingsTab): """ if self.saved_used_players: self.used_players = self.saved_used_players - self.used_players = get_media_players()[0] + # self.used_players = get_media_players()[0] self.saved_used_players = self.used_players settings = Settings() settings.beginGroup(self.settings_section) @@ -219,13 +219,13 @@ class PlayerTab(SettingsTab): settings.beginGroup(self.settings_section) settings.setValue('background color', self.background_color) settings.endGroup() - old_players, override_player = get_media_players() - if self.used_players != old_players: - # clean old Media stuff - set_media_players(self.used_players, override_player) - self.settings_form.register_post_process('mediaitem_suffix_reset') - self.settings_form.register_post_process('mediaitem_media_rebuild') - self.settings_form.register_post_process('config_screen_changed') + # old_players, override_player = get_media_players() + # if self.used_players != old_players: + # # clean old Media stuff + # set_media_players(self.used_players, override_player) + # self.settings_form.register_post_process('mediaitem_suffix_reset') + # self.settings_form.register_post_process('mediaitem_media_rebuild') + # self.settings_form.register_post_process('config_screen_changed') def post_set_up(self, post_update=False): """ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6dc4cf407..0b665fca2 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -641,8 +641,8 @@ class SongMediaItem(MediaManagerItem): service_item.background_audio = [m.file_path for m in song.media_files] service_item.set_media_length(total_length) service_item.metadata.append('{label}: {media}'. - format(label=translate('SongsPlugin.MediaItem', 'Media'), - media=service_item.background_audio)) + format(label=translate('SongsPlugin.MediaItem', 'Media'), + media=service_item.background_audio)) else: critical_error_message_box( translate('SongsPlugin.MediaItem', 'Missing Audio Software'), diff --git a/scripts/jenkins_script.py b/scripts/jenkins_script.py index fda227490..ce69a071d 100755 --- a/scripts/jenkins_script.py +++ b/scripts/jenkins_script.py @@ -103,7 +103,7 @@ class JenkinsTrigger(object): job_info = self.server.get_job_info(job_name) self.jobs[job_name] = job_info self.jobs[job_name]['nextBuildUrl'] = '{url}{nextBuildNumber}/'.format(**job_info) - except: + except Exception: pass def trigger_build(self): diff --git a/tests/functional/openlp_core/test_state.py b/tests/functional/openlp_core/test_state.py index d27e1bf9e..69252d33b 100644 --- a/tests/functional/openlp_core/test_state.py +++ b/tests/functional/openlp_core/test_state.py @@ -113,7 +113,7 @@ class TestState(TestCase, TestMixin): def test_basic_preconditions_fail(self): # GIVEN a new state State().load_settings() - plugin = Registry().register('test_plugin', MagicMock()) + Registry().register('test_plugin', MagicMock()) # WHEN I add a new services with dependencies and a failed pre condition State().add_service("test", 1, 1, PluginStatus.Inactive) diff --git a/tests/functional/openlp_plugins/songs/test_mediaitem.py b/tests/functional/openlp_plugins/songs/test_mediaitem.py index 39add90c2..a7c14eccc 100644 --- a/tests/functional/openlp_plugins/songs/test_mediaitem.py +++ b/tests/functional/openlp_plugins/songs/test_mediaitem.py @@ -432,7 +432,6 @@ class TestMediaItem(TestCase, TestMixin): song.authors_songs = [] song.songbook_entries = [] song.ccli_number = '' - # song.topics = None book1 = MagicMock() book1.name = 'My songbook' book2 = MagicMock() diff --git a/tests/interfaces/openlp_core/ui/test_mainwindow.py b/tests/interfaces/openlp_core/ui/test_mainwindow.py index 3156f9c9b..d86025eb9 100644 --- a/tests/interfaces/openlp_core/ui/test_mainwindow.py +++ b/tests/interfaces/openlp_core/ui/test_mainwindow.py @@ -64,7 +64,7 @@ class TestMainWindow(TestCase, TestMixin): patch('openlp.core.ui.mainwindow.ProjectorManager'), \ patch('openlp.core.ui.mainwindow.websockets.WebSocketServer'), \ patch('openlp.core.ui.mainwindow.PluginForm'), \ - patch('openlp.core.ui.mainwindow.server.HttpServer'): + patch('openlp.core.ui.mainwindow.server.HttpServer'): self.main_window = MainWindow() def tearDown(self):