forked from openlp/openlp
Bible search fix:
* Add feedback * cater for partial file-based bibles * Prevent an uncaught exception
This commit is contained in:
parent
5e0ab4a7f6
commit
04f2a9797b
@ -29,8 +29,9 @@ import chardet
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from sqlalchemy import or_
|
from sqlalchemy import or_
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import translate
|
||||||
from openlp.plugins.bibles.lib.models import *
|
from openlp.plugins.bibles.lib.models import *
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -312,6 +313,14 @@ class BibleDB(QtCore.QObject):
|
|||||||
.order_by(Verse.verse)\
|
.order_by(Verse.verse)\
|
||||||
.all()
|
.all()
|
||||||
verse_list.extend(verses)
|
verse_list.extend(verses)
|
||||||
|
else:
|
||||||
|
log.debug(u'OpenLP failed to find book %s', book)
|
||||||
|
QtGui.QMessageBox.information(self.bible_plugin.media_item,
|
||||||
|
translate(u'BibleDB', u'Book not found'),
|
||||||
|
translate(u'BibleDB', u'The book you requested could not '
|
||||||
|
u'be found in this bible. Please check your spelling '
|
||||||
|
u'and that this is a complete bible not just one '
|
||||||
|
u'testament.'))
|
||||||
return verse_list
|
return verse_list
|
||||||
|
|
||||||
def verse_search(self, text):
|
def verse_search(self, text):
|
||||||
@ -383,4 +392,3 @@ class BibleDB(QtCore.QObject):
|
|||||||
log.debug(u'...............................Verses ')
|
log.debug(u'...............................Verses ')
|
||||||
verses = self.session.query(Verse).all()
|
verses = self.session.query(Verse).all()
|
||||||
log.debug(verses)
|
log.debug(verses)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user