Esempio n. 1
0
 def noHashBarSpawn(self):
     child = None
     try:
         child = pexpect.spawn(self.cmd, args=self.args, 
                               timeout=self.timeout, logfile=self.output)
         child.expect(pexpect.EOF)
     except:
         self.output.write("[TIMEOUT] \n")
         if child and child.isalive():
             child.terminate(force=1)
Esempio n. 2
0
    def hashBarSpawn(self):

        tred = HashBar(self.timeout, None)
        tred.start()
        result = None
        fail   = None
        child  = None
        
        try:
            child = pexpect.spawn(self.cmd, args=self.args, timeout=self.timeout)
            child.expect("(rewrites: .*)Bye")
            result = str(child.match.groups()[0])
        except:
            fail = "[TIMEOUT]\n"
            if child and child.isalive():
                child.terminate(force=1)

##         tred.finished.getDone()
        tred.stop()
        tred.join()

        if result : self.output.write(result)
        if fail   : self.output.write(fail)