6.10.11.1.4. Capture command output

6.10.11.1.4. Capture command output

This is unix dependent at present.
Start python section to interscript/frames/inputf.py[31]
   767: #line 1124 "input_frame.ipk"
   768:   def capture_output(self,command):
   769:     commands = self.global_frame.commands
   770:     status, output = commands.getstatusoutput(command)
   771:     data = string.split(output,'\n')
   772:     return (status,data)
   773: 
   774:   def print_output(self,command):
   775:     status, data = self.capture_output(command)
   776:     weaver = self.get_weaver()
   777:     weaver.test_output_head(command, status)
   778:     for i in range(len(data)):
   779:       line = data[i]
   780:       l = string.rstrip(line)
   781:       weaver.echotangle(i+1,l)
   782:     weaver.test_output_foot(command, status)
   783:     return (status, data)
   784: 
   785:   def capture_python_output(self,script):
   786:     return self.capture_output(sys.executable+' '+script)
   787: 
   788:   def print_python_output(self,script):
   789:     return self.print_output(sys.executable+' '+script)
   790: 
   791:   def print_python_test_output(self,script, descr):
   792:     testno = self.pass_frame.get_new_test_number()
   793:     testlabel = 'test_'+str(testno)
   794:     self.pass_frame.tests[testno]=[descr,testlabel,'python','Unknown']
   795:     self.set_anchor(testlabel)
   796:     return self.print_python_output(script)
   797: 
End python section to interscript/frames/inputf.py[31]