Re: pexpect.exitstatus not working?

2005-09-06 Thread Adriaan Renting
I'm doing something along these lines: """Check if the task is finished and clean up.""" (pid, status) = os.waitpid(self._pid, os.WNOHANG) ## clean up the zombie assert(pid == self._pid) if os.WIFEXITED(status) or os.WIFSIGNALED(status): self._pid

Re: pexpect.exitstatus not working?

2005-09-01 Thread Laszlo Zsolt Nagy
Laszlo Zsolt Nagy wrote: >This function: > >def scp(from_path,to_path,pwd): >"""Copy a file with scp.""" >cmd = '/bin/csh -c "scp -q %s %s ; echo XXX"' %(from_path,to_path) >print cmd >child = pexpect.spawn(cmd) >child.expect('Password:') >child.sendline(pwd) >child

pexpect.exitstatus not working?

2005-09-01 Thread Laszlo Zsolt Nagy
This function: def scp(from_path,to_path,pwd): """Copy a file with scp.""" cmd = '/bin/csh -c "scp -q %s %s ; echo XXX"' %(from_path,to_path) print cmd child = pexpect.spawn(cmd) child.expect('Password:') child.sendline(pwd) child.expect('XXX') return child.exi