Gotta give the channel and id in deserialize.

This commit is contained in:
Jeremy Fincher 2004-02-07 23:56:32 +00:00
parent d451233ec7
commit 679b4dec26
3 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ class HeraldDB(plugins.ChannelUserDB):
def serialize(self, v): def serialize(self, v):
return [v] return [v]
def deserialize(self, L): def deserialize(self, channel, id, L):
if len(L) != 1: if len(L) != 1:
raise ValueError raise ValueError
return L[0] return L[0]

View File

@ -61,7 +61,7 @@ class SeenDB(plugins.ChannelUserDB):
def serialize(self, v): def serialize(self, v):
return list(v) return list(v)
def deserialize(self, L): def deserialize(self, channel, id, L):
(seen, saying) = L (seen, saying) = L
return (float(seen), saying) return (float(seen), saying)

View File

@ -209,7 +209,7 @@ class ChannelUserDB(ChannelUserDictionary):
except ValueError: except ValueError:
# We'll skip over this so, say, nicks can be kept here. # We'll skip over this so, say, nicks can be kept here.
pass pass
v = self.deserialize(t) v = self.deserialize(channel, id, t)
self[channel, id] = v self[channel, id] = v
except Exception, e: except Exception, e:
log.warning('Invalid line #%s in %s.', log.warning('Invalid line #%s in %s.',
@ -236,7 +236,7 @@ class ChannelUserDB(ChannelUserDictionary):
self.flush() self.flush()
self.clear() self.clear()
def deserialize(self, L): def deserialize(self, channel, id, L):
"""Should take a list of strings and return an object to be accessed """Should take a list of strings and return an object to be accessed
via self.get(channel, id).""" via self.get(channel, id)."""
raise NotImplementedError raise NotImplementedError