mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Hopefully Markov is now written with the lowest common denominator of the
idiotic anydbm in mind.
This commit is contained in:
parent
d253a8714a
commit
fd2f52970c
@ -162,7 +162,9 @@ class DbmMarkovDB(object):
|
|||||||
|
|
||||||
def follows(self, channel):
|
def follows(self, channel):
|
||||||
db = self._getDb(channel)
|
db = self._getDb(channel)
|
||||||
follows = [len(v.split()) for (k,v) in db.iteritems() if '\n' not in k]
|
# anydbm sucks in that we're not guaranteed to have .iteritems()
|
||||||
|
# *cough*gdbm*cough*, so this has to be done the stupid way
|
||||||
|
follows = [len(db[k].split()) for k in db.keys() if '\n' not in k]
|
||||||
return sum(follows)
|
return sum(follows)
|
||||||
|
|
||||||
MarkovDB = plugins.DB('Markov', {'anydbm': DbmMarkovDB})
|
MarkovDB = plugins.DB('Markov', {'anydbm': DbmMarkovDB})
|
||||||
|
Loading…
Reference in New Issue
Block a user