From 84d0c01274d0acab8326bed8254ceafa0bcf9484 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 9 Oct 2010 21:36:05 +0200 Subject: [PATCH] fixes for the merge proposal --- openlp/plugins/bibles/lib/db.py | 10 +++++----- openlp/plugins/bibles/lib/manager.py | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index cca8108a4..8f5c7dc79 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -353,8 +353,8 @@ class BibleDB(QtCore.QObject, Manager): QtGui.QMessageBox.information(self.bible_plugin.mediaItem, translate('BiblesPlugin.BibleDB', 'Book not found'), translate('BiblesPlugin.BibleDB', 'The book you requested ' - 'could not be found in this bible. Please check your ' - 'spelling and that this is a complete bible not just ' + 'could not be found in this Bible. Please check your ' + 'spelling and that this is a complete Bible not just ' 'one testament.')) return verse_list @@ -369,19 +369,19 @@ class BibleDB(QtCore.QObject, Manager): values. """ log.debug(u'BibleDB.verse_search("%s")', text) + verses = self.session.query(Verse) if text.find(u',') > -1: or_clause = [] keywords = [u'%%%s%%' % keyword.strip() for keyword in text.split(u',')] for keyword in keywords: or_clause.append(Verse.text.like(keyword)) - verses = self.session.query(Verse).filter(or_(*or_clause)) + verses = verses.filter(or_(*or_clause)) else: keywords = [u'%%%s%%' % keyword.strip() for keyword in text.split(u' ')] for keyword in keywords: - verses = self.session.query(Verse)\ - .filter(Verse.text.like(keyword)) + verses = verses.filter(Verse.text.like(keyword)) verses = verses.all() return verses diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 83aacd234..877331341 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -259,11 +259,13 @@ class BibleManager(object): def verse_search(self, bible, text): """ + Does a verse search for the given bible and text. + ``bible`` - The bible to seach in. + The bible to seach in (unicode). ``text`` - The text to search for. + The text to search for (unicode). """ log.debug(u'BibleManager.verse_search("%s", "%s")', bible, text) if text: @@ -273,7 +275,7 @@ class BibleManager(object): translate('BiblesPlugin.BibleManager', 'Scripture Reference Error'), 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 ' 'them by a comma to search for one of them.')) return None