mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Gave DBHandler a .die() method.
This commit is contained in:
parent
77a8d8bd2d
commit
2f7d2d7f61
@ -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
|
||||
|
@ -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:
|
||||
|
@ -99,6 +99,12 @@ class DBHandler(object):
|
||||
db = self.cachedDb
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user