mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +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):
|
def die(self):
|
||||||
# Handle DB stuff
|
# Handle DB stuff
|
||||||
db = self.dbHandler.getDb()
|
self.dbHandler.die()
|
||||||
db.commit()
|
|
||||||
db.close()
|
|
||||||
del db
|
|
||||||
|
|
||||||
def _parseFactoid(self, irc, msg, fact):
|
def _parseFactoid(self, irc, msg, fact):
|
||||||
type = "define" # Default is to just spit the factoid back as a
|
type = "define" # Default is to just spit the factoid back as a
|
||||||
|
@ -92,10 +92,7 @@ class Note(callbacks.Privmsg):
|
|||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
db = self.dbHandler.getDb()
|
self.dbHandler.die()
|
||||||
db.commit()
|
|
||||||
db.close()
|
|
||||||
del db
|
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
try:
|
try:
|
||||||
|
@ -100,6 +100,12 @@ class DBHandler(object):
|
|||||||
db.autocommit = 1
|
db.autocommit = 1
|
||||||
return db
|
return db
|
||||||
|
|
||||||
|
def die(self):
|
||||||
|
if self.cachedDb is not None:
|
||||||
|
self.cachedDb.die()
|
||||||
|
del self.cachedDb
|
||||||
|
|
||||||
|
|
||||||
class ChannelDBHandler(object):
|
class ChannelDBHandler(object):
|
||||||
"""A class to handle database stuff for individual channels transparently.
|
"""A class to handle database stuff for individual channels transparently.
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user