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