mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-03 01:39:23 +01:00
Added docstrings.
This commit is contained in:
parent
d4ba047b2f
commit
69493ebf88
@ -35,14 +35,17 @@ class ChannelDBHandler(object):
|
|||||||
self.suffix = suffix
|
self.suffix = suffix
|
||||||
|
|
||||||
def makeFilename(self, channel):
|
def makeFilename(self, channel):
|
||||||
|
"""Override this to specialize the filenames of your databases."""
|
||||||
channel = ircutils.toLower(channel)
|
channel = ircutils.toLower(channel)
|
||||||
prefix = '%s-%s%s' % (channel, self.__class__.__name__, self.suffix)
|
prefix = '%s-%s%s' % (channel, self.__class__.__name__, self.suffix)
|
||||||
return os.path.join(conf.dataDir, prefix)
|
return os.path.join(conf.dataDir, prefix)
|
||||||
|
|
||||||
def makeDb(self, filename):
|
def makeDb(self, filename):
|
||||||
|
"""Override this to create your databases."""
|
||||||
return cdb.shelf(filename)
|
return cdb.shelf(filename)
|
||||||
|
|
||||||
def getDb(self, channel):
|
def getDb(self, channel):
|
||||||
|
"""Use this to get a database for a specific channel."""
|
||||||
try:
|
try:
|
||||||
if self.threaded:
|
if self.threaded:
|
||||||
return self.makeDb(self.makeFilename(channel))
|
return self.makeDb(self.makeFilename(channel))
|
||||||
|
Loading…
Reference in New Issue
Block a user