mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-24 03:29:28 +01:00
eXXXtra eXXXtra, read all about it.
This commit is contained in:
parent
f63d77cfab
commit
0e5cd79a1b
@ -169,9 +169,11 @@ def makeChannelFilename(filename, channel=None, dirname=None):
|
|||||||
return conf.supybot.directories.data.dirize(filename)
|
return conf.supybot.directories.data.dirize(filename)
|
||||||
|
|
||||||
|
|
||||||
# XXX: This shouldn't be a mixin. This should be contained by classes that
|
# XXX This shouldn't be a mixin. This should be contained by classes that
|
||||||
# want such behavior. But at this point, it wouldn't gain much for us
|
# want such behavior. But at this point, it wouldn't gain much for us
|
||||||
# to refactor it.
|
# to refactor it.
|
||||||
|
# XXX We need to get rid of this, it's ugly and opposed to
|
||||||
|
# database-independence.
|
||||||
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.
|
||||||
"""
|
"""
|
||||||
@ -280,6 +282,10 @@ class ChannelUserDictionary(UserDict.DictMixin):
|
|||||||
return L
|
return L
|
||||||
|
|
||||||
|
|
||||||
|
# XXX The interface to this needs to be made *much* more like the dbi.DB
|
||||||
|
# interface. This is just too odd and not extensible; any extension
|
||||||
|
# would very much feel like an extension, rather than part of the db
|
||||||
|
# itself.
|
||||||
class ChannelUserDB(ChannelUserDictionary):
|
class ChannelUserDB(ChannelUserDictionary):
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
ChannelUserDictionary.__init__(self)
|
ChannelUserDictionary.__init__(self)
|
||||||
|
@ -158,6 +158,9 @@ class FlatfileMapping(MappingInterface):
|
|||||||
finally:
|
finally:
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
|
# XXX This assumes it's not been given out. We should make sure that our
|
||||||
|
# maximum id remains accurate if this is some value we've never given
|
||||||
|
# out -- i.e., self.maxid = max(self.maxid, id) or something.
|
||||||
def set(self, id, s):
|
def set(self, id, s):
|
||||||
strLine = self._joinLine(id, s)
|
strLine = self._joinLine(id, s)
|
||||||
try:
|
try:
|
||||||
@ -236,6 +239,7 @@ class CdbMapping(MappingInterface):
|
|||||||
def get(self, id):
|
def get(self, id):
|
||||||
return self.db[str(id)]
|
return self.db[str(id)]
|
||||||
|
|
||||||
|
# XXX Same as above.
|
||||||
def set(self, id, s):
|
def set(self, id, s):
|
||||||
self.db[str(id)] = s
|
self.db[str(id)] = s
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user