Index: /tbroadcast/v2/python/tbroadcast.py
===================================================================
--- /tbroadcast/v2/python/tbroadcast.py	(revision 239)
+++ /tbroadcast/v2/python/tbroadcast.py	(revision 240)
@@ -49,5 +49,5 @@
     def instanciate_packages(self):
         # We create the schedule of the work units
-        print '# First, we initialize the DAG by parsing cmt show uses (takes a certain time... huk should be improved asap) '
+        print '# First, we initialize the DAG by parsing cmt show uses'
         cmd = 'cmt show uses'
         status, output = commands.getstatusoutput (cmd)
@@ -117,5 +117,5 @@
                         sys.exit(-1) 
                     self.packages[result[0]]['path'] = full_path
-        print '# really takes a certain time ... '
+        print '# Sometimes takes a certain time (should be improved asap)'
 
     def get_current_package(self):    
@@ -198,5 +198,6 @@
         packages = self.get_next_work_units()
         if len(packages) !=0:
-            print '\n# Execute parallel actions within ', packages                      
+            print '\n#--------------------------------------------------------------'   
+            print '# Execute parallel actions within packages', packages                      
             for package in packages:
                 self.add_work_unit (package, command)
@@ -218,25 +219,29 @@
     # the work the threads will have to do 
     def do_execute(self, arg):
-        path = self.get_work_area_path (arg['package'])   
-        self.set_work_unit_status (arg['package'], 'running')      
-        cmd = "cmt -use="+ arg['package'] + " run '"+ arg['cmd'] + "'"
-        os.chdir(path)        
-        print '#--------------------------------------------------------------'
-        print '# Now trying ['+ arg['cmd']+'] in ' + path
-        print '#--------------------------------------------------------------'
-        cmd = arg['cmd']
-        status, output, error, pythonError  = exeCommand(cmd,  iTimeout = 10)      
-        self.suppress_work_unit (arg['package'])
-        self.set_work_unit_status (arg['package'], 'done')
-        # status, output= commands.getstatusoutput(cmd)
-        #print output
-        #if status != 0:
-        #   raise RuntimeError(output)
-        return {'output':output, 'cmd': arg['cmd'], 'package':arg['package']}
+      path = self.get_work_area_path (arg['package'])
+      if path == None:
+          raise RuntimeError('Path to package '+ arg['package'] +' not found')
+      self.set_work_unit_status (arg['package'], 'running')      
+      cmd = "cmt -use="+ arg['package'] + " run '"+ arg['cmd'] + "'"
+      os.chdir(path)        
+      print '#--------------------------------------------------------------'
+      print '# Now trying ['+ arg['cmd']+'] in ' + path
+      print '#--------------------------------------------------------------'
+      cmd = arg['cmd']
+      status, output, error, pythonError  = exeCommand(cmd,  iTimeout = 10)      
+      self.suppress_work_unit (arg['package'])
+      self.set_work_unit_status (arg['package'], 'done')
+      # status, output= commands.getstatusoutput(cmd)
+      #if status != 0:
+      #   raise RuntimeError(output)
+      return {'output':output, 'cmd': arg['cmd'], 'package':arg['package']}
               
     # this will be called when an exception occurs within a thread
     def handle_exception(self, request, exc_info):
         #traceback.print_stack()
-        print "# Exception occured in request #%s: %s" % \
-          (request.requestID, exc_info[1])
+      print '#--------------------------------------------------------------'        
+      #print "# Exception occured in request #%s: %s" %(request.requestID, exc_info[1])
+      print "# Exception occured: %s" %(exc_info[1])
+      print '#--------------------------------------------------------------'    
+      sys.exit(-1)
 #--------- EoF --------#    
Index: /tbroadcast/v2/scripts/tbroadcast
===================================================================
--- /tbroadcast/v2/scripts/tbroadcast	(revision 239)
+++ /tbroadcast/v2/scripts/tbroadcast	(revision 240)
@@ -1,3 +1,3 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 #----------------------------------#
 # -- Author: V.Garonne
@@ -13,19 +13,28 @@
 from tbroadcast import Scheduler
 
+def usage():
+    print 'Usage : > tbroadcast [global options] [<command>]'
+    print '# command :'
+    print '#   <command>: command to execute'
+    print '# global options :'
+    print '#   -nb=<num_worker>]                  : Total number of threads'
+    print '#   -help]                             : Print help'
+
 if __name__ == '__main__':
-
-    if len(sys.argv) ==1 :
-        print 'Usage : > tbroadcast [-nb=<num_worker>] <command>'
-        sys.exit(-1)    
-    num_worker = 20    
-    for arg in sys.argv:            
+    # Default options
+    num_worker = 20
+    command    = ''    
+    for arg in sys.argv[1:len(sys.argv)]:            
          if arg[0]=='-':
-             if string.split(arg,'=')[0] == '-nb':
+             option = string.split(arg,'=')[0]
+             if option == '-nb':
                 num_worker = int (string.split(arg,'=')[1])         
+             else:
+                usage()
+                sys.exit(-1)   
+                
          else:
               command = arg
-                      
-    # we create a pool of num_worker worker threads
-    #print 'num_worker', num_worker , command
+
     master = Scheduler (num_workers=num_worker)        
     master.execute_all (command)
