openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #07991
[Merge] lp:~googol-hush/openlp/bibles into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/bibles into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/bibles/+merge/57575
Hello,
- small clean ups
--
https://code.launchpad.net/~googol-hush/openlp/bibles/+merge/57575
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/bibles into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/db.py'
--- openlp/plugins/bibles/lib/db.py 2011-03-24 19:04:02 +0000
+++ openlp/plugins/bibles/lib/db.py 2011-04-13 19:36:56 +0000
@@ -177,10 +177,7 @@
Returns the version name of the Bible.
"""
version_name = self.get_object(BibleMeta, u'Version')
- if version_name:
- self.name = version_name.value
- else:
- self.name = None
+ self.name = version_name.value if version_name else None
return self.name
def clean_filename(self, old_filename):
@@ -256,10 +253,10 @@
# Text list has book and chapter as first two elements of the array.
for verse_number, verse_text in textlist.iteritems():
verse = Verse.populate(
- book_id = book_id,
- chapter = chapter,
- verse = verse_number,
- text = verse_text
+ book_id=book_id,
+ chapter=chapter,
+ verse=verse_number,
+ text=verse_text
)
self.session.add(verse)
self.session.commit()
@@ -383,15 +380,13 @@
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))
+ keywords = \
+ [u'%%%s%%' % keyword.strip() for keyword in text.split(u',')]
+ or_clause = [Verse.text.like(keyword) for keyword in keywords]
verses = verses.filter(or_(*or_clause))
else:
- keywords = [u'%%%s%%' % keyword.strip()
- for keyword in text.split(u' ')]
+ keywords = \
+ [u'%%%s%%' % keyword.strip() for keyword in text.split(u' ')]
for keyword in keywords:
verses = verses.filter(Verse.text.like(keyword))
verses = verses.all()
Follow ups