← 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:
  Tim Bentley (trb143)
  Samuel Findlay (sfindlay)
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/116131
-- 
https://code.launchpad.net/~phill-ridout/openlp/bug1020915/+merge/116131
Your team OpenLP Core is subscribed to branch 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-21 21:34:36 +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,8 +114,15 @@
                         (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')
+            log.exception(u'Loading Bible from OpenSong file failed')
             success = False
         finally:
             if file:


Follow ups