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):
return [v]
def deserialize(self, L):
def deserialize(self, channel, id, L):
if len(L) != 1:
raise ValueError
return L[0]

View File

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

View File

@ -209,7 +209,7 @@ class ChannelUserDB(ChannelUserDictionary):
except ValueError:
# We'll skip over this so, say, nicks can be kept here.
pass
v = self.deserialize(t)
v = self.deserialize(channel, id, t)
self[channel, id] = v
except Exception, e:
log.warning('Invalid line #%s in %s.',
@ -236,7 +236,7 @@ class ChannelUserDB(ChannelUserDictionary):
self.flush()
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
via self.get(channel, id)."""
raise NotImplementedError