make cvs pserver/ssh(2) connection with python

Marc m.bohlen at tu-bs.de
Sun Jul 7 18:08:24 EDT 2002


Im Artikel <Xns9244E88E74599cliechtigmxnet at 62.2.16.82> schrieb "Chris
Liechti" <cliechti at gmx.net>:

> [posted and mailed]
> 
> "Marc" <m.bohlen at tu-bs.de> wrote in
> news:20020707.223646.680466996.4043 at tu-bs.de:
>> I am searching a way to make a cvs pserver or/and a ssh(protocol
>> Version 2) connection with python under Linux/Unix. I've tried to
>> control the cvs pserver
>> connection by a python frontend which uses the normal cvs binary, but
>> it won't work without using the 'normal console interaction' for input
>> (maintainly the cvs login).
>> I can get the inputstream, but I can't write correctly to the
>> outputstream. I get the password query, but the answer fails. Perhaps
>> someone have experience in writing a frontend for interactive programms
>> under Linux/Unix and can help me.
> 
> do you use popen? something like that:
>>>> i,o = os.popen2("cat - >tmp")
>>>> i.write("hello")
>>>> i.close()
>>>> o.close()
At this time I use this:
os.popen(command)

The Problem isn't the reading and writing input-/outputstream, it's the
timing(I think). I make a 'cvs login' then I'll be asked for the cvs
password and the answer of this question fails. Perhaps I've to use the
tty or ptty module of python, but I don't know how. I'm searching a way
to handle his problem. I hope someone had similar problem (i.e. by
writing a frontend for ftp,telnet,ssh,... (for interactive applications)). 

the Python version is 1.5.2 (I think! It is a pool with 20(?)
workstations, different OS (Linux and Solaris, different versions)).
I think popen2 is available python-version>2 and if it exists another way
(as upgrade Pyhon) to solve the problem I'll use that way.

Insteat, if you know a way to solve my problem by useing popen2 please give me
a short example.



More information about the Python-list mailing list