mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-03 01:39:23 +01:00
Must've forgotten this one earlier.
This commit is contained in:
parent
019a648617
commit
f39b35eb9b
@ -12,6 +12,7 @@ import os
|
|||||||
import cdb
|
import cdb
|
||||||
import conf
|
import conf
|
||||||
import world
|
import world
|
||||||
|
import ircutils
|
||||||
import callbacks
|
import callbacks
|
||||||
|
|
||||||
class ChannelDBHandler(object):
|
class ChannelDBHandler(object):
|
||||||
@ -19,7 +20,7 @@ class ChannelDBHandler(object):
|
|||||||
"""
|
"""
|
||||||
suffix = '.db'
|
suffix = '.db'
|
||||||
def __init__(self, suffix='.db'):
|
def __init__(self, suffix='.db'):
|
||||||
self.dbCache = {}
|
self.dbCache = ircutils.IrcDict()
|
||||||
suffix = self.suffix
|
suffix = self.suffix
|
||||||
if self.suffix and self.suffix[0] != '.':
|
if self.suffix and self.suffix[0] != '.':
|
||||||
suffix = '.' + suffix
|
suffix = '.' + suffix
|
||||||
@ -34,7 +35,6 @@ class ChannelDBHandler(object):
|
|||||||
return cdb.shelf(filename)
|
return cdb.shelf(filename)
|
||||||
|
|
||||||
def getDb(self, channel):
|
def getDb(self, channel):
|
||||||
channel = ircutils.toLower(channel)
|
|
||||||
try:
|
try:
|
||||||
return self.dbCache[channel]
|
return self.dbCache[channel]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
Loading…
Reference in New Issue
Block a user