Alex
Alex

Reputation: 1124

python cvs check out

I am writing an automation script in python and I need to cvs update from script.

In bash my commands look like this:

cvs login
CVS Password:  <here i enter the password>
cvs update -P -d

I was using the sub-process module in python to do this, but it fails when it asks for the password.

Any ideas?

Upvotes: 0

Views: 1520

Answers (2)

daiuto
daiuto

Reputation: 486

Generally you can pass as arguments like this simplified code:

    ## program run.py
    def print_args(name, passwd):
       print name
       print passwd
    ## calling program
    import run
    input_name = raw_input("Enter name ")
    input_passwd = raw_input("Enter password ")
    run.print_args(input_name, input_passwd)

Upvotes: 1

Dhaivat Pandya
Dhaivat Pandya

Reputation: 6536

The pyCVS module can help you sovle the problem by using a binding.

In general, subprocesses have been, in my experience, much more trouble than just using a library that accomplishes the same thing.

Upvotes: 3

Related Questions