[pypy-svn] r30112 - pypy/dist/pypy/translator/cli
antocuni at codespeak.net
antocuni at codespeak.net
Mon Jul 17 14:09:43 CEST 2006
Author: antocuni
Date: Mon Jul 17 14:09:36 2006
New Revision: 30112
Modified:
pypy/dist/pypy/translator/cli/gencli.py
Log:
Added a sort of progress bar of the source generation.
Modified: pypy/dist/pypy/translator/cli/gencli.py
==============================================================================
--- pypy/dist/pypy/translator/cli/gencli.py (original)
+++ pypy/dist/pypy/translator/cli/gencli.py Mon Jul 17 14:09:36 2006
@@ -4,7 +4,7 @@
from pypy.translator.cli import conftest
from pypy.translator.cli.ilgenerator import IlasmGenerator
-from pypy.translator.cli.function import Function
+from pypy.translator.cli.function import Function, log
from pypy.translator.cli.class_ import Class
from pypy.translator.cli.option import getoption
from pypy.translator.cli.database import LowLevelDatabase
@@ -73,11 +73,18 @@
self.db.pending_function(self.translator.graphs[0])
def gen_pendings(self):
+ n = 0
while self.db._pending_nodes:
node = self.db._pending_nodes.pop()
node.render(self.ilasm)
self.db._rendered_nodes.add(node)
+ n+=1
+ total = len(self.db._pending_nodes) + n
+ log.graphs('Rendered %d/%d (approx. %.2f%%)' %\
+ (n, total, n*100.0/total))
+
+
def fix_names(self):
# it could happen that two distinct graph have the same name;
# here we assign an unique name to each graph.
More information about the Pypy-commit
mailing list