From 0e5cd79a1bd0941d06e9404ee696c4068dc9e83d Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 1 Oct 2004 08:22:48 +0000 Subject: [PATCH] eXXXtra eXXXtra, read all about it. --- plugins/__init__.py | 12 +++++++++--- src/dbi.py | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/plugins/__init__.py b/plugins/__init__.py index b08787cba..a777a9d4b 100644 --- a/plugins/__init__.py +++ b/plugins/__init__.py @@ -169,9 +169,11 @@ def makeChannelFilename(filename, channel=None, dirname=None): return conf.supybot.directories.data.dirize(filename) -# 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 -# to refactor it. +# 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 +# to refactor it. +# XXX We need to get rid of this, it's ugly and opposed to +# database-independence. class ChannelDBHandler(object): """A class to handle database stuff for individual channels transparently. """ @@ -280,6 +282,10 @@ class ChannelUserDictionary(UserDict.DictMixin): 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): def __init__(self, filename): ChannelUserDictionary.__init__(self) diff --git a/src/dbi.py b/src/dbi.py index 666c7f8ae..6275feed3 100644 --- a/src/dbi.py +++ b/src/dbi.py @@ -158,6 +158,9 @@ class FlatfileMapping(MappingInterface): finally: 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): strLine = self._joinLine(id, s) try: @@ -236,6 +239,7 @@ class CdbMapping(MappingInterface): def get(self, id): return self.db[str(id)] + # XXX Same as above. def set(self, id, s): self.db[str(id)] = s