← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~phill-ridout/openlp/bug1020915 into lp:openlp

 

phill has proposed merging lp:~phill-ridout/openlp/bug1020915 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1020915 in OpenLP: "OpenSong Bible import has uncaught exception on non-xml file"
  https://bugs.launchpad.net/openlp/+bug/1020915

For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/bug1020915/+merge/116058
-- 
https://code.launchpad.net/~phill-ridout/openlp/bug1020915/+merge/116058
Your team OpenLP Core is requested to review the proposed merge of lp:~phill-ridout/openlp/bug1020915 into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/opensong.py'
--- openlp/plugins/bibles/lib/opensong.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/bibles/lib/opensong.py	2012-07-20 19:30:24 +0000
@@ -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 @@
                         (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


Follow ups