From ab490862207d7d09ae6b65c4b756bba0c4e9b4c3 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 19 May 2008 23:21:00 -0300 Subject: [PATCH 1/1] Make some procman.ProcessManager's methods return the ProcessInfo instance. Now registar(), unregister() and once() procman.ProcessManager's methods returns the ProcessInfo instance just created/removed. --- pymin/procman.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pymin/procman.py b/pymin/procman.py index 554fdba..87e3282 100644 --- a/pymin/procman.py +++ b/pymin/procman.py @@ -80,12 +80,16 @@ class ProcessManager: log.debug(u'ProcessManager.register(%s, %s, %s, %s, %s, %s, %s)', name, command, callback, persist, max_errors, args, kwargs) assert not self.has(name) - self.services[name] = ProcessInfo(name, command, callback, persist, - max_errors, args, kwargs) + pi = ProcessInfo(name, command, callback, persist, max_errors, + args, kwargs) + self.services[name] = pi + return pi def unregister(self, name): log.debug(u'ProcessManager.unregister(%s)', name) + pi = self.services[name] del self.services[name] + return pi def _call(self, pi): pi.start() @@ -99,6 +103,7 @@ class ProcessManager: pi = ProcessInfo(name, command, callback, persist, max_errors, args, kwargs) self._call(pi) + return pi def start(self, name): log.debug(u'ProcessManager.start(%s)', name) -- 2.43.0