def progressbar(self, irc, msg, args, percent, width): """<percentage> [<width>] Draws a progress bar <width>+2 characters long (default: 25, minimum: 2, maximum: 50), filled in to <percent>. """ if not width: width = 25 irc.reply(wvm.progressbar(percent, width), prefixNick=False)
def activity(self, irc, msg, args, source): """[[<network>/]<channel>] Shows the level of conversation in this channel (or <channel on <network>, if specified), excluding lines directed at thes bot. """ source = wvm.nctuple(source, irc.network, msg.args[0]) data = self._getstats(source) if not data: irc.error('Currently no data for this channel.') return stats = "{0}: {1} \\ {2}: {3} \\ {4}: {5}".format( ircutils.bold('Short-term'), wvm.progressbar(30.0 / data[1] * 100), ircutils.bold('Long-term'), wvm.progressbar(30.0 / data[2] * 100), ircutils.bold('Samples'), data[3], ) irc.reply(stats)