From 70e50f4aaa47fea2e95815e6d9f31652ecad5a2c Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Sat, 30 Sep 2017 23:45:24 +0100 Subject: [PATCH] Pep fixes --- openlp/plugins/songs/lib/importers/cclifile.py | 4 ++-- openlp/plugins/songs/lib/importers/dreambeam.py | 3 ++- openlp/plugins/songs/lib/importers/presentationmanager.py | 2 +- openlp/plugins/songs/lib/importers/videopsalm.py | 3 ++- openlp/plugins/songs/lib/openlyricsexport.py | 2 +- tests/functional/openlp_plugins/songs/test_ewimport.py | 3 +-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/songs/lib/importers/cclifile.py b/openlp/plugins/songs/lib/importers/cclifile.py index de32e4d3c..223263183 100644 --- a/openlp/plugins/songs/lib/importers/cclifile.py +++ b/openlp/plugins/songs/lib/importers/cclifile.py @@ -80,8 +80,8 @@ class CCLIFileImport(SongImport): if not self.do_import_txt_file(lines): self.log_error(file_path) else: - self.log_error(file_path, translate('SongsPlugin.CCLIFileImport', 'The file does not have a valid ' - 'extension.')) + self.log_error(file_path, translate('SongsPlugin.CCLIFileImport', + 'The file does not have a valid extension.')) log.info('Extension {name} is not valid'.format(name=file_path)) if self.stop_import_flag: return diff --git a/openlp/plugins/songs/lib/importers/dreambeam.py b/openlp/plugins/songs/lib/importers/dreambeam.py index 451811e8e..094827792 100644 --- a/openlp/plugins/songs/lib/importers/dreambeam.py +++ b/openlp/plugins/songs/lib/importers/dreambeam.py @@ -99,7 +99,8 @@ class DreamBeamImport(SongImport): if song_xml.tag != 'DreamSong': self.log_error( file_path, - translate('SongsPlugin.DreamBeamImport', 'Invalid DreamBeam song file_path. Missing DreamSong tag.')) + translate('SongsPlugin.DreamBeamImport', + 'Invalid DreamBeam song file_path. Missing DreamSong tag.')) continue if hasattr(song_xml, 'Version'): self.version = float(song_xml.Version.text) diff --git a/openlp/plugins/songs/lib/importers/presentationmanager.py b/openlp/plugins/songs/lib/importers/presentationmanager.py index cf5364a7e..2ea23679b 100644 --- a/openlp/plugins/songs/lib/importers/presentationmanager.py +++ b/openlp/plugins/songs/lib/importers/presentationmanager.py @@ -76,7 +76,7 @@ class PresentationManagerImport(SongImport): def process_song(self, root, file_path): """ - :param root: + :param root: :param openlp.core.common.path.Path file_path: Path to the file to process :rtype: None """ diff --git a/openlp/plugins/songs/lib/importers/videopsalm.py b/openlp/plugins/songs/lib/importers/videopsalm.py index 0e14481a5..ef020997a 100644 --- a/openlp/plugins/songs/lib/importers/videopsalm.py +++ b/openlp/plugins/songs/lib/importers/videopsalm.py @@ -130,4 +130,5 @@ class VideoPsalmImport(SongImport): if not self.finish(): self.log_error('Could not import {title}'.format(title=self.title)) except Exception as e: - self.log_error(self.import_source.name, translate('SongsPlugin.VideoPsalmImport', 'Error: {error}').format(error=e)) + self.log_error(self.import_source.name, + translate('SongsPlugin.VideoPsalmImport', 'Error: {error}').format(error=e)) diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index 2d4383f60..430e37da5 100644 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -40,7 +40,7 @@ class OpenLyricsExport(RegistryProperties): def __init__(self, parent, songs, save_path): """ Initialise the export. - + :param openlp.core.common.path.Path save_path: The directory to save the exported songs in :rtype: None """ diff --git a/tests/functional/openlp_plugins/songs/test_ewimport.py b/tests/functional/openlp_plugins/songs/test_ewimport.py index 8f8525d89..2440c1271 100644 --- a/tests/functional/openlp_plugins/songs/test_ewimport.py +++ b/tests/functional/openlp_plugins/songs/test_ewimport.py @@ -304,7 +304,6 @@ class TestEasyWorshipSongImport(TestCase): mocked_manager = MagicMock() importer = EasyWorshipSongImport(mocked_manager, file_paths=[]) with patch.object(importer, 'log_error') as mocked_log_error: - #importer.log_error = MagicMock() # WHEN: do_import is supplied with an import source (Songs.MB missing) importer.import_source = 'Songs.DB' @@ -368,7 +367,7 @@ class TestEasyWorshipSongImport(TestCase): # GIVEN: A mocked out SongImport class, a mocked out "manager" with patch('openlp.plugins.songs.lib.importers.easyworship.SongImport'), \ patch('openlp.plugins.songs.lib.importers.easyworship.Path.is_file', return_value=True), \ - patch('openlp.plugins.songs.lib.importers.easyworship.Path.stat', **{'return_value.st_size':0x800}), \ + patch('openlp.plugins.songs.lib.importers.easyworship.Path.stat', **{'return_value.st_size': 0x800}), \ patch('openlp.plugins.songs.lib.importers.easyworship.Path.open'), \ patch('builtins.open'), patch('openlp.plugins.songs.lib.importers.easyworship.struct') as mocked_struct, \ patch('openlp.plugins.songs.lib.importers.easyworship.retrieve_windows_encoding') as \