6.23.10.2.24. Capture command output

This is unix dependent at present.
Comienzo python section to interscript/frames/inputf.py[33 /41 ] Siguiente Previo Primero Ăšltimo
   990: #line 1339 "input_frame.ipk"
   991:   def capture_output(self,command):
   992:     commands = self.global_frame.commands
   993:     status, output = commands.getstatusoutput(command)
   994:     data = string.split(output,'\n')
   995:     return (status,data)
   996: 
   997:   def print_output(self,command,description=None):
   998:     status, data = self.capture_output(command)
   999:     weaver = self.get_weaver()
  1000:     if description: cmd = description
  1001:     else: cmd = command
  1002:     weaver.test_output_head(cmd, status)
  1003:     for i in range(len(data)):
  1004:       line = data[i]
  1005:       l = string.rstrip(line)
  1006:       weaver.echotangle(i+1,l)
  1007:     weaver.test_output_foot(cmd, status)
  1008:     return (status, data)
  1009: 
  1010:   def capture_python_output(self,script):
  1011:     return self.capture_output('"'+sys.executable+'" '+script)
  1012: 
  1013:   def print_python_output(self,script, description=None):
  1014:     return self.print_output(
  1015:       '"'+sys.executable+'" '+script,
  1016:       description)
  1017: 
  1018:   def print_python_test_output(self,script, descr):
  1019:     testno = self.pass_frame.get_new_test_number()
  1020:     testlabel = 'test_'+str(testno)
  1021:     self.pass_frame.tests[testno]=[descr,testlabel,'python','Unknown']
  1022:     self.set_anchor(testlabel)
  1023:     return self.print_python_output(script,descr)
  1024: 
End python section to interscript/frames/inputf.py[33]