Editing two files in PVCS with Python ? (was:Run an external...)

Steffen Ries steffen.ries at sympatico.ca
Sun Nov 12 08:26:29 EST 2000


V <V at V.V> writes:
...
> So first I make the correct system calls as above to check-out, update
> and check-in the first makefile. But after the check-in :
> 
>         os.system(' put c:\something\foo.c ')
> 
> the version control system prints something like this :
> 
>         "version 1.5 of file foo.c was checked in."
> 
> The problem is that how do get the version number from the first
> check-in, because it's needed in the second makefile update ?

If you use os.popen('put c:\\something\\foo.c', 'r') instead of
os.system(), you get a file object attached to stdout of the `put'
command.

You can read from this file and analyze the output to find the version
number you are looking for.

> Michael S. is talking something about "the output of the command" above.
> Is that what I need and how do I "check out the commands module" ?

Read the fine manual, e.g. at:
http://www.pythonlabs.com/doc/manuals/python2.0/lib/module-commands.html

hth,
/steffen
-- 
steffen.ries at sympatico.ca	<> Gravity is a myth -- the Earth sucks!



More information about the Python-list mailing list