mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-14 14:49:21 +01:00
Status: add 'processes' command, the multiprocessing equivalent of the threads command.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
parent
7f98aa7105
commit
7f4a1be9f9
@ -94,6 +94,18 @@ class Status(callbacks.Plugin):
|
||||
irc.reply(s)
|
||||
threads = wrap(threads)
|
||||
|
||||
def processes(self, irc, msg, args):
|
||||
"""takes no arguments
|
||||
|
||||
Returns the number of processes that have been spawned.
|
||||
"""
|
||||
# TODO: maintain a dict of active subprocesses, so we can
|
||||
# include a list thereof in output, linke in threads(). maybe?
|
||||
s = format('I have spawned %n.',
|
||||
(world.processesSpawned, 'process'))
|
||||
irc.reply(s)
|
||||
processes = wrap(processes)
|
||||
|
||||
def net(self, irc, msg, args):
|
||||
"""takes no arguments
|
||||
|
||||
|
@ -71,6 +71,8 @@ class StatusTestCase(PluginTestCase):
|
||||
def testThreads(self):
|
||||
self.assertNotError('threads')
|
||||
|
||||
def testProcesses(self):
|
||||
self.assertNotError('processes')
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user