mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Gotta give the channel and id in deserialize.
This commit is contained in:
parent
d451233ec7
commit
679b4dec26
@ -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]
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user