From dfed68943468c349b24fc928ff5c4b533c829fbe Mon Sep 17 00:00:00 2001 From: pcarrier Date: Sat, 27 Nov 2010 16:53:52 +0000 Subject: [worker] Slightly simplified shell API and init git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1034 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- worker/worker.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'worker/worker.py') diff --git a/worker/worker.py b/worker/worker.py index 335bcbf8..812eb4cb 100644 --- a/worker/worker.py +++ b/worker/worker.py @@ -75,18 +75,12 @@ class ExecRequest(Request): self.shell.write_blob(stderr) class Shell: - def __init__(self, - input_stream = None, - output_stream = None, - status_stream = None, - bork_action = None): + def __init__(self, input_stream, output_stream, status_stream, + bork_action = None): self.__input_stream__ = input_stream self.__output_stream__ = output_stream self.__status_stream__ = status_stream - if bork_action: - self.__bork_action__ = bork_action - else: - self.__bork_action__ = self.exit + self.__bork_action__ = bork_action or self.exit self.__exit__ = False self.__cmd_number__ = 0 @@ -153,7 +147,4 @@ if __name__ == "__main__": signal(SIGUSR1, handler) def bork(): exit(-1) - Shell(input_stream = stdin, - output_stream = stdout, - status_stream = stderr, - bork_action = bork).loop() + Shell(stdin, stdout, stderr, bork_action = bork).loop() -- cgit