From: <ate...@us...> - 2006-04-26 01:02:14
|
Revision: 92 Author: atenderholt Date: 2006-04-25 18:02:03 -0700 (Tue, 25 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=92&view=rev Log Message: ----------- Created a progress directory. So far, only textprogress will be implemented, although others may be added in the future. Modified Paths: -------------- trunk/src/cclib/__init__.py Added Paths: ----------- trunk/src/cclib/progress/ trunk/src/cclib/progress/__init__.py trunk/src/cclib/progress/textprogress.py Removed Paths: ------------- trunk/src/cclib/parser/textprogress.py Modified: trunk/src/cclib/__init__.py =================================================================== --- trunk/src/cclib/__init__.py 2006-04-25 22:37:15 UTC (rev 91) +++ trunk/src/cclib/__init__.py 2006-04-26 01:02:03 UTC (rev 92) @@ -1 +1,2 @@ import parser +import progress Deleted: trunk/src/cclib/parser/textprogress.py =================================================================== --- trunk/src/cclib/parser/textprogress.py 2006-04-25 22:37:15 UTC (rev 91) +++ trunk/src/cclib/parser/textprogress.py 2006-04-26 01:02:03 UTC (rev 92) @@ -1,46 +0,0 @@ -import sys -import thread - -class TextProgress: - - def __init__(self): - - self.nstep=0 - self.text=None - self.oldprogress=0 - self.progress=0 - self.calls=0 - - def initialize(self,nstep,text=None): - - self.nstep=float(nstep) - self.text=text - - #sys.stdout.write("\n") - - def update(self,step,text=None): - - self.progress = int(step*100/self.nstep) - - if self.progress/2>=self.oldprogress/2+1 or self.text!=text: #just went through at least an interval of ten, ie. from 39 to 41, so update - - str="\r[" - prog=self.progress/10 - str+=prog*"="+(10-prog)*"-" - str+="] %3i"%(self.progress)+"%" - - if text: - str+=" Parsing "+text - - sys.stdout.write("\r"+70*" ") - sys.stdout.flush() - sys.stdout.write(str) - sys.stdout.flush() - self.oldprogress=self.progress - - if(self.progress>=100 and text=="Done"): - print " " - - - return - Added: trunk/src/cclib/progress/__init__.py =================================================================== --- trunk/src/cclib/progress/__init__.py (rev 0) +++ trunk/src/cclib/progress/__init__.py 2006-04-26 01:02:03 UTC (rev 92) @@ -0,0 +1 @@ +from textprogress import TextProgress Copied: trunk/src/cclib/progress/textprogress.py (from rev 89, trunk/src/cclib/parser/textprogress.py) =================================================================== --- trunk/src/cclib/progress/textprogress.py (rev 0) +++ trunk/src/cclib/progress/textprogress.py 2006-04-26 01:02:03 UTC (rev 92) @@ -0,0 +1,46 @@ +import sys +import thread + +class TextProgress: + + def __init__(self): + + self.nstep=0 + self.text=None + self.oldprogress=0 + self.progress=0 + self.calls=0 + + def initialize(self,nstep,text=None): + + self.nstep=float(nstep) + self.text=text + + #sys.stdout.write("\n") + + def update(self,step,text=None): + + self.progress = int(step*100/self.nstep) + + if self.progress/2>=self.oldprogress/2+1 or self.text!=text: #just went through at least an interval of ten, ie. from 39 to 41, so update + + str="\r[" + prog=self.progress/10 + str+=prog*"="+(10-prog)*"-" + str+="] %3i"%(self.progress)+"%" + + if text: + str+=" Parsing "+text + + sys.stdout.write("\r"+70*" ") + sys.stdout.flush() + sys.stdout.write(str) + sys.stdout.flush() + self.oldprogress=self.progress + + if(self.progress>=100 and text=="Done"): + print " " + + + return + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |