From: Julian Schaefer-J. <jul...@t-...> - 2002-07-22 18:54:09
|
> Had a look through the mail archives. I'd be interested in having a look > at > Julian's patch. There you go: ---- Snipp ---> 87c87,89 < time.sleep(delay) # being over cautious --- > output=os.read(fd, bufSize) # read the banner (eg everything before sys-prompt) > if debug: debug.write('>> child says: %r\n' % output) > time.sleep(delay) # being over cautious ---- Snipp ---> My substitute (previously posted) can be found here (with a little luck @dialup): http://wgfalk.dyndns.org/people/snippets/pyssh2/ > I have also done a patched version. In fact, I've also patched the tty > module, since tty.spawn was broken. > > I was after a version that would work in Windows with Putty's command line > version, and I'm hoping that my approach will. Under Linux I've then got > a > wrapper (that uses my patched tty.spawn) that enables ssh to be used with > os.popen2. I'm pretty sure that there is no tty stuff to worry about on > windows, so Putty's command line should be fine. > As for windows - I came up with the putty-idea as well - but since you can't select() file-descriptors in windows, I didn't do any work on it. It should present a pretty awful solution to provide the password on putty-prompt and provide an input-file for commands to be executed. This way it would be possible to later parse the complete output. If you come up with something better I' d love to hear about it. Greets, Julian. |