From: <bao...@us...> - 2006-03-10 10:04:41
|
Revision: 15 Author: baoilleach Date: 2006-03-10 02:04:34 -0800 (Fri, 10 Mar 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=15&view=rev Log Message: ----------- Very slight improvements in the section dealing with the progress. Modified Paths: -------------- trunk/src/cclib/parser/g03parser.py Modified: trunk/src/cclib/parser/g03parser.py =================================================================== --- trunk/src/cclib/parser/g03parser.py 2006-03-09 19:54:18 UTC (rev 14) +++ trunk/src/cclib/parser/g03parser.py 2006-03-10 10:04:34 UTC (rev 15) @@ -19,6 +19,7 @@ """ import math,sys,logging,copy,re,os,time # How many of these are necessary? import Numeric +import random # For sometimes running the progress updater from logfileparser import Logfile # import the superclass class G03(Logfile): @@ -57,16 +58,16 @@ nstep=inputfile.tell() inputfile.seek(0) self.progress.initialize(nstep) - self.oldstep=0 + oldstep=0 for line in inputfile: - if self.progress: + if self.progress and random.random()<0.05: - step=inputfile.tell() - if not (step==self.oldstep): + step = inputfile.tell() + if step!=oldstep: self.progress.update(step) - self.oldstep=step + oldstep = step if line[1:8]=="NAtoms=": # Find the number of atoms This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |