forked from openlp/openlp
Add method to fully load bible
bzr-revno: 71
This commit is contained in:
parent
4d42c84ddb
commit
c6d1051e82
@ -87,7 +87,7 @@ class BibleManager:
|
||||
nhttp = BibleHTTPImpl()
|
||||
nhttp.setBibleSource(biblesource)
|
||||
self.bibleHTTPCache[name] = nhttp
|
||||
nbible.loadMeta("WEB", biblesource)
|
||||
nbible.loadMeta("WEB", biblesource) # register a lazy loading interest
|
||||
|
||||
def registerBible(self, name, booksfile, versefile):
|
||||
"""
|
||||
@ -101,6 +101,24 @@ class BibleManager:
|
||||
nbible.loadData(booksfile, versefile)
|
||||
self.bibleDBCache[name] = nbible
|
||||
|
||||
def loadBible(self,bible):
|
||||
print "loadBible ", bible
|
||||
"""
|
||||
Downloads all the books of the bible
|
||||
and loads it into the database
|
||||
"""
|
||||
for bk in self.listOfBooks:
|
||||
cptrs = self.booksChapters[ self.booksOfBible[bk]]
|
||||
print bk , self.booksChapters[ self.booksOfBible[bk]]
|
||||
for chptr in range(1 , int(cptrs)): # loop through all the chapters in book
|
||||
c = self.bibleDBCache[bible].getBibleChapter(bk, chptr) # check to see if book/chapter exists
|
||||
print c
|
||||
if not c:
|
||||
print "missing ", bk, chptr
|
||||
self._loadBook(bible,bk)
|
||||
self._loadChapter(bible, bk, chptr)
|
||||
|
||||
|
||||
def getBibles(self):
|
||||
"""
|
||||
Returns a list of Books of the bible
|
||||
|
@ -2,7 +2,7 @@ Genesis,1
|
||||
Exodus,2
|
||||
Leviticus,3
|
||||
Numbers,4
|
||||
Deutoronomy,5
|
||||
Deuteronomy,5
|
||||
Psalms,23
|
||||
Matthew,47
|
||||
Mark,48
|
||||
|
Loading…
Reference in New Issue
Block a user