Gave DBHandler a .die() method.

This commit is contained in:
Jeremy Fincher 2003-12-02 22:40:33 +00:00
parent 77a8d8bd2d
commit 2f7d2d7f61
3 changed files with 8 additions and 8 deletions

View File

@ -155,10 +155,7 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
def die(self):
# Handle DB stuff
db = self.dbHandler.getDb()
db.commit()
db.close()
del db
self.dbHandler.die()
def _parseFactoid(self, irc, msg, fact):
type = "define" # Default is to just spit the factoid back as a

View File

@ -92,10 +92,7 @@ class Note(callbacks.Privmsg):
db.commit()
def die(self):
db = self.dbHandler.getDb()
db.commit()
db.close()
del db
self.dbHandler.die()
def doPrivmsg(self, irc, msg):
try:

View File

@ -100,6 +100,12 @@ class DBHandler(object):
db.autocommit = 1
return db
def die(self):
if self.cachedDb is not None:
self.cachedDb.die()
del self.cachedDb
class ChannelDBHandler(object):
"""A class to handle database stuff for individual channels transparently.
"""