completed work

This commit is contained in:
Andreas Preikschat 2010-12-05 16:47:23 +01:00
parent a66a77bdec
commit b8e6da0417

View File

@ -73,15 +73,17 @@ class OpenLP1Bible(BibleDB):
self.create_book(name, abbreviation, testament_id) self.create_book(name, abbreviation, testament_id)
self.session.commit() self.session.commit()
# Import chapters/verses. # Import chapters/verses.
cursor.execute(u'SELECT id, book_id, chapter, verse, text || \'\' AS ' for book in books:
'text FROM verse') print u'Importiere %s' % book
verses = cursor.fetchall() cursor.execute(u'SELECT id, book_id, chapter, verse, text || \'\' '
for verse in verses: 'AS text FROM verse WHERE book_id=%s' % book)
book_id = int(verse[1]) verses = cursor.fetchall()
chapter = int(verse[2]) for verse in verses:
verse_number = int(verse[3]) book_id = int(verse[1])
text = unicode(verse[4], u'cp1252') chapter = int(verse[2])
self.create_verse(book_id, chapter, verse_number, text) verse_number = int(verse[3])
self.session.commit() text = unicode(verse[4], u'cp1252')
self.create_verse(book_id, chapter, verse_number, text)
self.session.commit()
return True return True