diff --git a/sandbox/Debug.py b/sandbox/Debug.py index ac3360988..a4ecdd1f6 100644 --- a/sandbox/Debug.py +++ b/sandbox/Debug.py @@ -38,6 +38,7 @@ __revision__ = "$Id$" import supybot.plugins as plugins +import gc import sys import exceptions @@ -163,6 +164,19 @@ class Debug(privmsgs.CapabilityCheckingPrivmsg): irc.reply(channel) channeldb = wrap(channeldb, ['channeldb']) + def collect(self, irc, msg, args, times): + """[] + + Does gc collections, returning the number of objects collected + each time. defaults to 1. + """ + L = [] + while times: + L.append(gc.collect()) + times -= 1 + irc.reply(utils.commaAndify(map(str, L))) + collect = wrap(collect, [additional('positiveInt', 1)]) + Class = Debug