Changeset 393 for tbroadcast
- Timestamp:
- Mar 22, 2007, 5:57:11 PM (17 years ago)
- Location:
- tbroadcast/HEAD
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tbroadcast/HEAD/python/tbroadcast.py
r316 r393 15 15 import commands 16 16 import traceback 17 import exceptions 17 18 from threading import BoundedSemaphore 18 19 … … 26 27 class Scheduler: 27 28 28 def __init__(self, num_workers=20, file=None, ignore_cycles=False, local=False, output=None, error=None, silent = False, perf=False ):29 def __init__(self, num_workers=20, file=None, ignore_cycles=False, local=False, output=None, error=None, silent = False, perf=False, keep_going=True): 29 30 self.pool = ThreadPool(num_workers=num_workers) 30 31 self.current_package = self.get_current_package() … … 39 40 self.silent = silent 40 41 self.perf = perf 42 self.keep_going = keep_going 41 43 if self.perf is not False: 42 44 f = open (self.perf, 'w+') … … 450 452 self.packages[arg['package']] ['startTime'] = time.time () 451 453 status, output, error, pythonError = exeCommand(sCmd=cmd, oLineCallback=self.redirectOutput, arg=arg)#,iTimeout = 3600) 454 if not self.keep_going and status > 0: 455 sys.exit(status) 456 452 457 self.packages[arg['package']] ['endTime'] = time.time () 453 458 if self.perf: … … 488 493 print '#--------------------------------------------------------------' 489 494 #print "# Exception occured in request #%s: %s" %(request.requestID, exc_info[1]) 490 print "# Exception occured: %s" %(exc_info[1]) 495 if exc_info[0]== exceptions.SystemExit: 496 print "Stop execution (No_keep_going option enabled): exit code == %s " %(exc_info[1]) 497 print '#--------------------------------------------------------------' 498 sys.exit(exc_info[1]) 499 print "# Exception occured: %s" %(exc_info[1]) 491 500 print exc_info 492 501 print '#--------------------------------------------------------------' -
tbroadcast/HEAD/scripts/tbroadcast
r309 r393 24 24 print '# -global : Reach packages in all CMTPATH/CMTPROJECTPATH items' 25 25 print '# -ignore_cycles : Suppress automatically the cycles' 26 print '# -make=<file> : Generate a recursive Make, see: http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html'26 print '# -make=<file> : Generate a recursive Make, [see: http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html]' 27 27 print '# -nb=<num_worker> : Change the total number of threads[default is 20]' 28 print '# -no_keep_going : Exit after the first exit code > 1 found and return it in the shell' 28 29 print '# -output=<location> : Output directory to store output files with the form <package>_output.log' 29 30 print '# -error=<location> : Output directory to store error output with the form <package>_error.log' … … 38 39 num_worker = 20 39 40 command = '' 40 version = ' v2.0.3'41 version = 'HEAD' 41 42 test = False 42 43 check = False … … 51 52 make = None 52 53 makefile = 'Makefile' 54 keep_going = True 53 55 54 56 if len(sys.argv) == 1: … … 76 78 ignore_cycles = True 77 79 if option == '-silent': 78 silent = True 80 silent = True 81 if option == '-no_keep_going': 82 keep_going = False 83 79 84 if option == '-help': 80 85 usage() … … 93 98 command = arg 94 99 95 master = Scheduler (num_workers=num_worker, file=file, ignore_cycles=ignore_cycles, local=local, output=output, error=error, silent=silent, perf=perf) 100 master = Scheduler (num_workers=num_worker, file=file, ignore_cycles=ignore_cycles, 101 local=local, output=output, error=error, silent=silent, perf=perf, 102 keep_going=keep_going) 96 103 if test: 97 104 master.simulate_execution() … … 104 111 else: 105 112 master.execute_all (command) 106 sys.exit(-1);113 #sys.exit(-1); 107 114 #--------- EoF --------#
Note: See TracChangeset
for help on using the changeset viewer.