forked from openlp/openlp
Pep fixes
This commit is contained in:
parent
d8a32d3962
commit
70e50f4aaa
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
"""
|
||||
|
@ -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))
|
||||
|
@ -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
|
||||
"""
|
||||
|
@ -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 \
|
||||
|
Loading…
Reference in New Issue
Block a user