Return-Path: Delivered-To: apmail-gump-general-archive@www.apache.org Received: (qmail 50547 invoked from network); 19 Jul 2004 22:34:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 19 Jul 2004 22:34:06 -0000 Received: (qmail 12510 invoked by uid 500); 19 Jul 2004 22:34:06 -0000 Delivered-To: apmail-gump-general-archive@gump.apache.org Received: (qmail 12461 invoked by uid 500); 19 Jul 2004 22:34:05 -0000 Mailing-List: contact general-help@gump.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Gump code and data" Reply-To: "Gump code and data" Delivered-To: mailing list general@gump.apache.org Received: (qmail 12448 invoked by uid 500); 19 Jul 2004 22:34:05 -0000 Received: (qmail 12443 invoked by uid 99); 19 Jul 2004 22:34:05 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Mon, 19 Jul 2004 15:34:05 -0700 Received: (qmail 50529 invoked by uid 1728); 19 Jul 2004 22:34:04 -0000 Date: 19 Jul 2004 22:34:04 -0000 Message-ID: <20040719223404.50528.qmail@minotaur.apache.org> From: ajack@apache.org To: gump-cvs@apache.org Subject: cvs commit: gump/python/gump/process command.py launcher.py X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ajack 2004/07/19 15:34:04 Modified: python/gump/process command.py launcher.py Log: The new launcher was failing to set/pass TIMEOUT, so none existed. Revision Changes Path 1.2 +1 -1 gump/python/gump/process/command.py Index: command.py =================================================================== RCS file: /home/cvs/gump/python/gump/process/command.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- command.py 14 Jul 2004 20:47:01 -0000 1.1 +++ command.py 19 Jul 2004 22:34:04 -0000 1.2 @@ -163,7 +163,7 @@ class Cmd: """Command Line (executable plus parameters)""" - def __init__(self,command,name=None,cwd=None,env=None,timeout=None): + def __init__(self,command,name=None,cwd=None,env=None,timeout=setting.timeout): self.cmdpath=command self.name=name if not self.name: 1.5 +23 -10 gump/python/gump/process/launcher.py Index: launcher.py =================================================================== RCS file: /home/cvs/gump/python/gump/process/launcher.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- launcher.py 19 Jul 2004 16:07:57 -0000 1.4 +++ launcher.py 19 Jul 2004 22:34:04 -0000 1.5 @@ -154,7 +154,7 @@ return result -def killChildProcesses(): +def shutdownProcesses(): """ Kill this (and all child processes). """ @@ -165,12 +165,14 @@ gumpid except Exception, details: log.error('Failed to dispatch signal ' + str(details), exc_info=1) - -if __name__=='__main__': - import re + +def runProcess(execFilename): + """ - exit_code=0 - execFilename=sys.argv[1] + Read an 'exec file' (formatted by Gump) to detect what to run, + and how to run it. + + """ execFile=None try: execFile=file(execFilename,'r') @@ -186,8 +188,8 @@ cwd=None if execInfo.has_key('CWD'):cwd=execInfo['CWD'] tmp=execInfo['TMP'] - timeout=None - if execInfo.has_key('TIMEOUT'):timeout=execInfo['TIMEOUT'] + timeout=0 + if execInfo.has_key('TIMEOUT'):timeout=int(execInfo['TIMEOUT']) # Make the TMP if needed if not os.path.exists(tmp): os.makedirs(tmp) @@ -206,8 +208,8 @@ # Timeout support timer=None if timeout: - import thread - timer = thread.Timer(timeout, killChildProcesses) + import threading + timer = threading.Timer(timeout, shutdownProcesses) timer.setDaemon(1) timer.start() @@ -236,6 +238,17 @@ finally: if execFile: execFile.close() + + return exit_code + +if __name__=='__main__': + import re + + exit_code=0 + execFilename=sys.argv[1] + + # Run the information within this file... + exit_code=runProcess(execFilename) # print 'Exit: ' + `exit_code` sys.exit(exit_code) --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscribe@gump.apache.org For additional commands, e-mail: general-help@gump.apache.org