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):
|
if not self.do_import_txt_file(lines):
|
||||||
self.log_error(file_path)
|
self.log_error(file_path)
|
||||||
else:
|
else:
|
||||||
self.log_error(file_path, translate('SongsPlugin.CCLIFileImport', 'The file does not have a valid '
|
self.log_error(file_path, translate('SongsPlugin.CCLIFileImport',
|
||||||
'extension.'))
|
'The file does not have a valid extension.'))
|
||||||
log.info('Extension {name} is not valid'.format(name=file_path))
|
log.info('Extension {name} is not valid'.format(name=file_path))
|
||||||
if self.stop_import_flag:
|
if self.stop_import_flag:
|
||||||
return
|
return
|
||||||
|
|
|
@ -99,7 +99,8 @@ class DreamBeamImport(SongImport):
|
||||||
if song_xml.tag != 'DreamSong':
|
if song_xml.tag != 'DreamSong':
|
||||||
self.log_error(
|
self.log_error(
|
||||||
file_path,
|
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
|
continue
|
||||||
if hasattr(song_xml, 'Version'):
|
if hasattr(song_xml, 'Version'):
|
||||||
self.version = float(song_xml.Version.text)
|
self.version = float(song_xml.Version.text)
|
||||||
|
|
|
@ -130,4 +130,5 @@ class VideoPsalmImport(SongImport):
|
||||||
if not self.finish():
|
if not self.finish():
|
||||||
self.log_error('Could not import {title}'.format(title=self.title))
|
self.log_error('Could not import {title}'.format(title=self.title))
|
||||||
except Exception as e:
|
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))
|
||||||
|
|
|
@ -304,7 +304,6 @@ class TestEasyWorshipSongImport(TestCase):
|
||||||
mocked_manager = MagicMock()
|
mocked_manager = MagicMock()
|
||||||
importer = EasyWorshipSongImport(mocked_manager, file_paths=[])
|
importer = EasyWorshipSongImport(mocked_manager, file_paths=[])
|
||||||
with patch.object(importer, 'log_error') as mocked_log_error:
|
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)
|
# WHEN: do_import is supplied with an import source (Songs.MB missing)
|
||||||
importer.import_source = 'Songs.DB'
|
importer.import_source = 'Songs.DB'
|
||||||
|
|
Loading…
Reference in New Issue