Index: tbroadcast/HEAD/python/tbroadcast.py
===================================================================
--- tbroadcast/HEAD/python/tbroadcast.py	(revision 478)
+++ tbroadcast/HEAD/python/tbroadcast.py	(revision 508)
@@ -18,11 +18,11 @@
 from threading import BoundedSemaphore
 
-from threadpool import WorkRequest
-from threadpool import ThreadPool
-from threadpool import NoResultsPending
-from threadpool import NoWorkersAvailable
-from threadpool import  makeRequests
-from executer   import  exeCommand
-from executer   import  getstatusoutput
+from threadpool  import WorkRequest
+from threadpool  import ThreadPool
+from threadpool  import NoResultsPending
+from threadpool  import NoWorkersAvailable
+from threadpool  import  makeRequests
+
+from  subprocess import Popen
 
 class Scheduler:
@@ -72,6 +72,5 @@
     def get_current_project(self):
         cmd = 'cmt show projects | grep current'
-        status, output = getstatusoutput (cmd)
-#        status, output = commands.getstatusoutput (cmd)
+        status, output = commands.getstatusoutput (cmd)
         if status != 0:
             print output
@@ -100,6 +99,5 @@
         cmd = 'cmt -private show cycles'
         cycle_found = False
-        status, output = getstatusoutput (cmd)
-#        status, output = commands.getstatusoutput (cmd)
+        status, output = commands.getstatusoutput (cmd)
         if status != 0:
             print output
@@ -252,6 +250,5 @@
         else:    
             cmd = 'cat ' + file        
-        status, output = getstatusoutput (cmd)
-#        status, output = commands.getstatusoutput (cmd)
+        status, output = commands.getstatusoutput (cmd)
         if status != 0:
             print output
@@ -312,7 +309,6 @@
 
     def get_current_package(self):    
-        cmd = 'cmt show macro package'
-        status, output = getstatusoutput (cmd)
-#        status, output = commands.getstatusoutput (cmd)
+        cmd            = 'cmt show macro package'
+        status, output = commands.getstatusoutput (cmd)
         if status != 0:
             print output
@@ -331,6 +327,5 @@
         #return os.getcwd ()
         cmd = 'cmt -use='+name+' run pwd'
-        status, output = getstatusoutput (cmd)
-#        status, output = commands.getstatusoutput (cmd)
+        status, output = commands.getstatusoutput (cmd)
         if status != 0:
             print output
@@ -392,5 +387,5 @@
             # we create requests
             arg = {'cmd': cmd , 'package':name}
-            req = WorkRequest(self.do_execute, [arg] , None, callback=self.result_callback, exc_callback=self.handle_exception) 
+            req = WorkRequest(self.do_execute, [arg] , None, callback=self.result_callback) 
             # then we put the work request in the queue...
             self.set_work_unit_status (name, 'queued')
@@ -441,21 +436,30 @@
       print header
       project_path = self.current_project['path']+'/'+self.current_project['version']+'/'
-      log_name   =  string.replace(path, project_path, '')
-      log_name   = string.replace(log_name, '/cmt', '')
-      log_name   = string.replace(log_name, '/', '_')
-      log_name   = log_name+'.loglog'
-      arg['log'] = log_name
+      log_name     = string.replace(path, project_path, '')
+      log_name     = string.replace(log_name, '/cmt', '')
+      log_name     = string.replace(log_name, '/', '_')
+      log_name     = log_name+'.loglog'
+      arg['log']   = log_name
       cmd = "cd "+ path +";"+ arg['cmd'] 
       #status, output= commands.getstatusoutput(cmd)
       # init output file
+
+      self.packages[arg['package']] ['startTime'] = time.time ()                           
+
       if self.output is not None:
-           f = open (self.output+'/'+ log_name, 'w+')
-           f.write (header)
-           f.close()      
-           if self.error is not None:
-               f = open (self.error+'/error'+log_name, 'w+')
-               f.close()
-      self.packages[arg['package']] ['startTime'] = time.time ()                           
-      status, output, error, pythonError  = exeCommand(sCmd=cmd, oLineCallback=self.redirectOutput, arg=arg)#,iTimeout = 3600)
+           f1 = open (self.output+'/'+ log_name, 'w+')           
+           f1.write (header)
+           f1.close()
+           f1 = open (self.output+'/'+ log_name, 'a')
+           if self.error is not None:        
+               f2 = open (self.error+'/error'+log_name, 'w+')               
+               Popen(cmd, shell=True, stdout=f1, stderr=f2).communicate()
+               f2.close()  
+           else:
+               Popen(cmd, shell=True, stdout=f1, stderr=f1).communicate()
+           f1.close()               
+      else:
+          Popen(cmd, shell=True).communicate()
+      
       if not self.keep_going and status > 0:
         sys.exit(status)   
@@ -473,24 +477,6 @@
       #if status != 0:
       #   raise RuntimeError(output)
-      return {'output':output, 'cmd': arg['cmd'], 'package':arg['package']}
-
-    def redirectOutput(self, index, buffer, arg):
-        """Filter function to redirect the std output and error of the job
-           executable for real-time debugging 
-        """
-        if self.output is not None:
-           if index==0:   
-               f = open (self.output+'/'+arg['log'], 'a')
-               f.write (buffer+'\n')
-               f.close()
-           elif index==1: 
-               if self.error is not None:
-                   f = open (self.error+'/error'+arg['log'], 'a')
-               else:
-                   f = open (self.output+'/'+arg['log'], 'a')                   
-               f.write (buffer+'\n')                   
-               f.close()                               
-        if not self.silent: 
-            print buffer
+      return {'cmd': arg['cmd'], 'package':arg['package']}
+
               
     # this will be called when an exception occurs within a thread
