From 6bebc383b45c0de6e27ae339f6cf87480d8edd0b Mon Sep 17 00:00:00 2001 From: James Vega Date: Thu, 20 Aug 2009 10:48:41 -0400 Subject: [PATCH] ChannelStats.rank now starts from 1 instead of 0 Signed-off-by: James Vega (cherry picked from commit 169aee3bc0ba39c5bea37c6798f62ab21e9b6b30) --- plugins/ChannelStats/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/ChannelStats/plugin.py b/plugins/ChannelStats/plugin.py index d5c77ab30..baf768007 100644 --- a/plugins/ChannelStats/plugin.py +++ b/plugins/ChannelStats/plugin.py @@ -1,5 +1,6 @@ ### # Copyright (c) 2002-2004, Jeremiah Fincher +# Copyright (c) 2009, James Vega # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,6 +61,7 @@ class ChannelStat(irclib.IrcCommandDispatcher): self.smileys = smileys self.topics = topics self.words = words + def values(self): return [getattr(self, s) for s in self._values] @@ -311,7 +313,7 @@ class ChannelStats(callbacks.Plugin): users.append((v, ircdb.users.getUser(id).name)) users.sort() users.reverse() - s = utils.str.commaAndify(['#%s %s (%.3g)' % (i, u, v) + s = utils.str.commaAndify(['#%s %s (%.3g)' % (i+1, u, v) for (i, (v, u)) in enumerate(users)]) irc.reply(s) rank = wrap(rank, ['channeldb', 'text'])