forked from openlp/openlp
Fix local bible quick search.
Fix OpenSong CUV bible import. bzr-revno: 1220
This commit is contained in:
commit
149f0bd31e
@ -340,11 +340,11 @@ class BibleDB(QtCore.QObject, Manager):
|
|||||||
verse_list = []
|
verse_list = []
|
||||||
for book, chapter, start_verse, end_verse in reference_list:
|
for book, chapter, start_verse, end_verse in reference_list:
|
||||||
db_book = self.get_book(book)
|
db_book = self.get_book(book)
|
||||||
if end_verse == -1:
|
|
||||||
end_verse = self.get_verse_count(book, chapter)
|
|
||||||
if db_book:
|
if db_book:
|
||||||
book = db_book.name
|
book = db_book.name
|
||||||
log.debug(u'Book name corrected to "%s"', book)
|
log.debug(u'Book name corrected to "%s"', book)
|
||||||
|
if end_verse == -1:
|
||||||
|
end_verse = self.get_verse_count(book, chapter)
|
||||||
verses = self.session.query(Verse)\
|
verses = self.session.query(Verse)\
|
||||||
.filter_by(book_id=db_book.id)\
|
.filter_by(book_id=db_book.id)\
|
||||||
.filter_by(chapter=chapter)\
|
.filter_by(chapter=chapter)\
|
||||||
|
@ -79,7 +79,7 @@ class OpenSongBible(BibleDB):
|
|||||||
break
|
break
|
||||||
self.create_verse(
|
self.create_verse(
|
||||||
db_book.id,
|
db_book.id,
|
||||||
int(chapter.attrib[u'n']),
|
int(chapter.attrib[u'n'].split()[-1]),
|
||||||
int(verse.attrib[u'n']),
|
int(verse.attrib[u'n']),
|
||||||
unicode(verse.text)
|
unicode(verse.text)
|
||||||
)
|
)
|
||||||
@ -87,7 +87,7 @@ class OpenSongBible(BibleDB):
|
|||||||
self.wizard.incrementProgressBar(unicode(translate(
|
self.wizard.incrementProgressBar(unicode(translate(
|
||||||
'BiblesPlugin.Opensong', 'Importing %s %s...',
|
'BiblesPlugin.Opensong', 'Importing %s %s...',
|
||||||
'Importing <book name> <chapter>...')) %
|
'Importing <book name> <chapter>...')) %
|
||||||
(db_book.name, int(chapter.attrib[u'n'])))
|
(db_book.name, int(chapter.attrib[u'n'].split()[-1])))
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
except (IOError, AttributeError):
|
except (IOError, AttributeError):
|
||||||
log.exception(u'Loading bible from OpenSong file failed')
|
log.exception(u'Loading bible from OpenSong file failed')
|
||||||
|
Loading…
Reference in New Issue
Block a user