<br><span class="gmail_quote">Does anyone in the group have any experience with interacting with CVS from Python?<br><br></span>I've written a script which will checkout files from CVS, however, I don' t know how to check for normal completion, errors or exceptions.
<br><br>There are many people using CVS for this massive project, so we can't just switch to a source control which has better scripting abilities.&nbsp;
We are stuck with CVS, so please don't reply with &quot;Don't use CVS&quot;<br><br><br>def SendCVSCommand(self)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__cvsCmd = &quot;cvs update -A -C someArchiveName&quot; # hard-coded for brevity<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hProcess = popen(self.__cvsCmd, &quot;r&quot;) # will run the cvs command, and checkout this module to the current directory
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep(timeToWait)<br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # how to check for errors?<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hProcess.close()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; except: # bad idea, but better than nothing for now
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__FatalError = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print&quot;\nException was encountered while processing this cvs command line %s\n&quot; % self.__cvsCmd<br><br><br><br><br>I'm using 30 seconds for the sleep time, but what I would like to do is exit this routine early, if the CVS command finishes before 30 seconds are up.
<br>I don't know how to check if the cvs command has finised normally, or with errors.<br><br><br>Does anyone have any suggestions how to handle erros or completion in a process like this?<br><br>thanks<br><br>