mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added the collect command.
This commit is contained in:
parent
cba61a9dfe
commit
ff8379b7b4
@ -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):
|
||||
"""[<times>]
|
||||
|
||||
Does <times> gc collections, returning the number of objects collected
|
||||
each time. <times> 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user