diff --git a/plugins/Status/plugin.py b/plugins/Status/plugin.py index 10ae9d824..1bc0dd2cf 100644 --- a/plugins/Status/plugin.py +++ b/plugins/Status/plugin.py @@ -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 diff --git a/plugins/Status/test.py b/plugins/Status/test.py index 4843c4145..de456b061 100644 --- a/plugins/Status/test.py +++ b/plugins/Status/test.py @@ -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: