[pypy-svn] r72132 - pypy/trunk/pypy/jit/tool

fijal at codespeak.net fijal at codespeak.net
Thu Mar 11 21:02:55 CET 2010


Author: fijal
Date: Thu Mar 11 21:02:52 2010
New Revision: 72132

Modified:
   pypy/trunk/pypy/jit/tool/otherviewer.py
Log:
minor improvements to otherviewer


Modified: pypy/trunk/pypy/jit/tool/otherviewer.py
==============================================================================
--- pypy/trunk/pypy/jit/tool/otherviewer.py	(original)
+++ pypy/trunk/pypy/jit/tool/otherviewer.py	Thu Mar 11 21:02:52 2010
@@ -223,7 +223,13 @@
         loop.ratio = opsno
     else:
         loop.ratio = float(opsno) / bcodes
-    loop.content = "Logfile at %d" % loop.startlineno
+    content = loop.content
+    lines = content.split("\n")
+    if len(lines) > 100:
+        lines = lines[100:] + ["%d more lines..." % (len(lines) - 100)]
+    for i, line in enumerate(lines):
+        lines[i] = re.sub("\[.*\]", "", line)
+    loop.content = "Logfile at %d\n" % loop.startlineno + "\n".join(lines)
     loop.postprocess(loops, memo)
 
 def postprocess(loops, allloops):



More information about the Pypy-commit mailing list