Hopefully Markov is now written with the lowest common denominator of the

idiotic anydbm in mind.
This commit is contained in:
James Vega 2004-12-10 02:43:33 +00:00
parent d253a8714a
commit fd2f52970c

View File

@ -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})