From fd2f52970ce42c6bca3bc6c1709ef50e4f0ed104 Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 10 Dec 2004 02:43:33 +0000 Subject: [PATCH] Hopefully Markov is now written with the lowest common denominator of the idiotic anydbm in mind. --- plugins/Markov.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Markov.py b/plugins/Markov.py index f94c77a77..48e93efbc 100644 --- a/plugins/Markov.py +++ b/plugins/Markov.py @@ -162,7 +162,9 @@ class DbmMarkovDB(object): def follows(self, 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) MarkovDB = plugins.DB('Markov', {'anydbm': DbmMarkovDB})