More Changes and fix ups

bzr-revno: 232
This commit is contained in:
Tim Bentley 2008-12-16 21:48:17 +00:00
parent 2457713b1d
commit fc4e947be0
3 changed files with 12 additions and 10 deletions

View File

@ -71,8 +71,8 @@ class BibleCSVImpl(BibleCommon):
p3 = p[3].replace('"', '') p3 = p[3].replace('"', '')
if book_ptr is not p0: if book_ptr is not p0:
cl = self.bibledb.get_bible_book(p0) cl = self.bibledb.get_bible_book(p0)
id = self.bibledb.getBibleBookId(p0) id = self.bibledb.get_bible_book_Id(p0)
book_ptr = cl book_ptr = cl
log.debug( id ) log.debug( id )
self.bibledb.addVerse(id[0], p[1], p[2], p3) self.bibledb.add_verse(id[0], p[1], p[2], p3)

View File

@ -128,7 +128,7 @@ class BibleDBImpl(BibleCommon):
self.Session = sessionmaker() self.Session = sessionmaker()
self.Session.configure(bind=self.db) self.Session.configure(bind=self.db)
def createTables(self): def create_tables(self):
log.debug( "createTables") log.debug( "createTables")
if os.path.exists(self.biblefile): # delete bible file and set it up again if os.path.exists(self.biblefile): # delete bible file and set it up again
os.remove(self.biblefile) os.remove(self.biblefile)
@ -139,8 +139,8 @@ class BibleDBImpl(BibleCommon):
self.save_meta("dbversion", "2") self.save_meta("dbversion", "2")
self._loadTestaments() self._loadTestaments()
def addVerse(self, bookid, chap, verse, text): def add_verse(self, bookid, chap, verse, text):
log.debug( "addVerse %s,%s,%s,%s", bookid, chap, verse, text) log.debug( "add_verse %s,%s,%s,%s", bookid, chap, verse, text)
metadata.bind.echo = False metadata.bind.echo = False
session = self.Session() session = self.Session()
versemeta = Verse(book_id=int(bookid), chapter=int(chap), verse=int(verse), text=(text)) versemeta = Verse(book_id=int(bookid), chapter=int(chap), verse=int(verse), text=(text))
@ -148,7 +148,7 @@ class BibleDBImpl(BibleCommon):
session.commit() session.commit()
def create_chapter(self, bookid, chap, textlist): def create_chapter(self, bookid, chap, textlist):
log.debug( "createChapter %s,%s,%s", bookid, chap, textlist) log.debug( "create_chapter %s,%s,%s", bookid, chap, textlist)
metadata.bind.echo = False metadata.bind.echo = False
session = self.Session() session = self.Session()
#s = text (""" select id FROM book where book.name == :b """) #s = text (""" select id FROM book where book.name == :b """)
@ -161,7 +161,7 @@ class BibleDBImpl(BibleCommon):
session.commit() session.commit()
def create_book(self, bookid, bookname, bookabbrev): def create_book(self, bookid, bookname, bookabbrev):
log.debug( "createBook %s,%s,%s", bookid, bookname, bookabbrev) log.debug( "create_book %s,%s,%s", bookid, bookname, bookabbrev)
metadata.bind.echo = False metadata.bind.echo = False
session = self.Session() session = self.Session()
bookmeta = Book(int(5), bookname, bookabbrev) bookmeta = Book(int(5), bookname, bookabbrev)
@ -179,13 +179,13 @@ class BibleDBImpl(BibleCommon):
s = text (""" select value FROM metadata where key == :k """) s = text (""" select value FROM metadata where key == :k """)
return self.db.execute(s, k=key).fetchone() return self.db.execute(s, k=key).fetchone()
def deleteMeta(self, key): def delete_meta(self, key):
metadata.bind.echo = False metadata.bind.echo = False
s = text (""" delete FROM meta where key == :k """) s = text (""" delete FROM meta where key == :k """)
self.db.execute(s, k=key) self.db.execute(s, k=key)
def _loadTestaments(self): def _load_testaments(self):
log.debug("loadTestaments") log.debug("load_testaments")
metadata.bind.echo = False metadata.bind.echo = False
session = self.Session() session = self.Session()
testmeta = ONTestament(name="Old Testament") testmeta = ONTestament(name="Old Testament")

View File

@ -148,6 +148,8 @@ class BibleManager():
""" """
r=[] r=[]
for b , o in self.bibleDBCache.iteritems(): for b , o in self.bibleDBCache.iteritems():
if mode != "full":
print self.bibleHTTPCache[b]
r.append(b) r.append(b)
return r return r