forked from openlp/openlp
Name it rather OpenLyricsError
This commit is contained in:
parent
28fa03b7cd
commit
86df7d9734
@ -38,7 +38,7 @@ from openlp.core.ui.wizard import WizardStrings
|
||||
from openlp.plugins.songs.lib.songimport import SongImport
|
||||
from openlp.plugins.songs.lib.ui import SongStrings
|
||||
from openlp.plugins.songs.lib import OpenLyrics
|
||||
from openlp.plugins.songs.lib.xml import OpenLyricsException
|
||||
from openlp.plugins.songs.lib.xml import OpenLyricsError
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -74,7 +74,7 @@ class OpenLyricsImport(SongImport):
|
||||
except etree.XMLSyntaxError:
|
||||
log.exception(u'XML syntax error in file %s' % file_path)
|
||||
self.logError(file_path, SongStrings.XMLSyntaxError)
|
||||
except OpenLyricsException as exception:
|
||||
except OpenLyricsError as exception:
|
||||
log.exception(u'OpenLyricsException of type %s: %s in file %s'
|
||||
% (exception.type, exception.message, file_path))
|
||||
if exception.type is 'XML':
|
||||
|
@ -676,11 +676,11 @@ class OpenLyrics(object):
|
||||
try:
|
||||
lyrics = song_xml.lyrics
|
||||
except AttributeError:
|
||||
raise OpenLyricsException('XML', 'missing lyrics item')
|
||||
raise OpenLyricsError('XML', 'missing lyrics item')
|
||||
try:
|
||||
verses = lyrics.verse
|
||||
except AttributeError:
|
||||
raise OpenLyricsException('XML', 'missing verse item')
|
||||
raise OpenLyricsError('XML', 'missing verse item')
|
||||
# Loop over the "verse" elements.
|
||||
for verse in verses:
|
||||
text = u''
|
||||
@ -800,7 +800,7 @@ class OpenLyrics(object):
|
||||
xml_declaration=True, pretty_print=True)
|
||||
|
||||
|
||||
class OpenLyricsException(Exception):
|
||||
class OpenLyricsError(Exception):
|
||||
"""
|
||||
By now raised only in case of missing lyrics or verse element in XML.
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user