mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +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 supybot.plugins as plugins
|
||||||
|
|
||||||
|
import gc
|
||||||
import sys
|
import sys
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
||||||
@ -163,6 +164,19 @@ class Debug(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
irc.reply(channel)
|
irc.reply(channel)
|
||||||
channeldb = wrap(channeldb, ['channeldb'])
|
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
|
Class = Debug
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user