[Tutor] handling timeouts, normal completion, or exceptions when interacting with CVS
alan.gauld at btinternet.com
Mon Nov 20 06:17:59 CET 2006
"Tony Cappellini" <cappy2112 at gmail.com> wrote
> def SendCVSCommand(self)
> self.__cvsCmd = "cvs update -A -C someArchiveName"
> hProcess = popen(self.__cvsCmd, "r") # will run the cvs
> and checkout this module to the current directory
> # HOW LONG DO WE WAIT BEFORE CONTINUING????
> # how do we check for errors??????????
I don't think you need the sleep because the call to popen won't
return untl the command has completed.
And you check for errors by reading the output from stdout
and stderr just as you would at a console.
result = hProcess.read()
and parse the string in result.
You probably want to use popen2 or popen3 to separate the
Author of the Learn to Program web site
More information about the Tutor