forked from openlp/openlp
fixes for the merge proposal
This commit is contained in:
parent
2ad3f983f7
commit
84d0c01274
@ -353,8 +353,8 @@ class BibleDB(QtCore.QObject, Manager):
|
|||||||
QtGui.QMessageBox.information(self.bible_plugin.mediaItem,
|
QtGui.QMessageBox.information(self.bible_plugin.mediaItem,
|
||||||
translate('BiblesPlugin.BibleDB', 'Book not found'),
|
translate('BiblesPlugin.BibleDB', 'Book not found'),
|
||||||
translate('BiblesPlugin.BibleDB', 'The book you requested '
|
translate('BiblesPlugin.BibleDB', 'The book you requested '
|
||||||
'could not be found in this bible. Please check your '
|
'could not be found in this Bible. Please check your '
|
||||||
'spelling and that this is a complete bible not just '
|
'spelling and that this is a complete Bible not just '
|
||||||
'one testament.'))
|
'one testament.'))
|
||||||
return verse_list
|
return verse_list
|
||||||
|
|
||||||
@ -369,19 +369,19 @@ class BibleDB(QtCore.QObject, Manager):
|
|||||||
values.
|
values.
|
||||||
"""
|
"""
|
||||||
log.debug(u'BibleDB.verse_search("%s")', text)
|
log.debug(u'BibleDB.verse_search("%s")', text)
|
||||||
|
verses = self.session.query(Verse)
|
||||||
if text.find(u',') > -1:
|
if text.find(u',') > -1:
|
||||||
or_clause = []
|
or_clause = []
|
||||||
keywords = [u'%%%s%%' % keyword.strip()
|
keywords = [u'%%%s%%' % keyword.strip()
|
||||||
for keyword in text.split(u',')]
|
for keyword in text.split(u',')]
|
||||||
for keyword in keywords:
|
for keyword in keywords:
|
||||||
or_clause.append(Verse.text.like(keyword))
|
or_clause.append(Verse.text.like(keyword))
|
||||||
verses = self.session.query(Verse).filter(or_(*or_clause))
|
verses = verses.filter(or_(*or_clause))
|
||||||
else:
|
else:
|
||||||
keywords = [u'%%%s%%' % keyword.strip()
|
keywords = [u'%%%s%%' % keyword.strip()
|
||||||
for keyword in text.split(u' ')]
|
for keyword in text.split(u' ')]
|
||||||
for keyword in keywords:
|
for keyword in keywords:
|
||||||
verses = self.session.query(Verse)\
|
verses = verses.filter(Verse.text.like(keyword))
|
||||||
.filter(Verse.text.like(keyword))
|
|
||||||
verses = verses.all()
|
verses = verses.all()
|
||||||
return verses
|
return verses
|
||||||
|
|
||||||
|
@ -259,11 +259,13 @@ class BibleManager(object):
|
|||||||
|
|
||||||
def verse_search(self, bible, text):
|
def verse_search(self, bible, text):
|
||||||
"""
|
"""
|
||||||
|
Does a verse search for the given bible and text.
|
||||||
|
|
||||||
``bible``
|
``bible``
|
||||||
The bible to seach in.
|
The bible to seach in (unicode).
|
||||||
|
|
||||||
``text``
|
``text``
|
||||||
The text to search for.
|
The text to search for (unicode).
|
||||||
"""
|
"""
|
||||||
log.debug(u'BibleManager.verse_search("%s", "%s")', bible, text)
|
log.debug(u'BibleManager.verse_search("%s", "%s")', bible, text)
|
||||||
if text:
|
if text:
|
||||||
@ -273,7 +275,7 @@ class BibleManager(object):
|
|||||||
translate('BiblesPlugin.BibleManager',
|
translate('BiblesPlugin.BibleManager',
|
||||||
'Scripture Reference Error'),
|
'Scripture Reference Error'),
|
||||||
translate('BiblesPlugin.BibleManager', 'You did not enter a '
|
translate('BiblesPlugin.BibleManager', 'You did not enter a '
|
||||||
'search keyword.\nYou can seperate different keywords by a '
|
'search keyword.\nYou can separate different keywords by a '
|
||||||
'space to search for all of your keywords and you can seperate '
|
'space to search for all of your keywords and you can seperate '
|
||||||
'them by a comma to search for one of them.'))
|
'them by a comma to search for one of them.'))
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user