forked from openlp/openlp
Fix for bug:1020915 OpenSong Bible import has uncaught exception on non-xml file
This commit is contained in:
parent
08c258a9f1
commit
73ad78e3ad
@ -27,9 +27,10 @@
|
||||
###############################################################################
|
||||
|
||||
import logging
|
||||
from lxml import objectify
|
||||
from lxml import etree, objectify
|
||||
|
||||
from openlp.core.lib import Receiver, translate
|
||||
from openlp.core.lib.ui import critical_error_message_box
|
||||
from openlp.plugins.bibles.lib.db import BibleDB, BiblesResourcesDB
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -113,6 +114,13 @@ class OpenSongBible(BibleDB):
|
||||
(db_book.name, int(chapter.attrib[u'n'].split()[-1])))
|
||||
self.session.commit()
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
except etree.XMLSyntaxError as inst:
|
||||
critical_error_message_box(
|
||||
message=translate('BiblesPlugin.OpenSongImport',
|
||||
'Incorrect bible file type supplied. OpenSong bibles may be '
|
||||
'compressed. You must decompress them before import.'))
|
||||
log.exception(inst)
|
||||
success = False
|
||||
except (IOError, AttributeError):
|
||||
log.exception(u'Loading bible from OpenSong file failed')
|
||||
success = False
|
||||
|
Loading…
Reference in New Issue
Block a user