mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +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):
|
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]
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user