[pypy-svn] r28234 - in pypy/dist/pypy/translator/tool: . pygame

arigo at codespeak.net arigo at codespeak.net
Sun Jun 4 12:02:40 CEST 2006


Author: arigo
Date: Sun Jun  4 12:02:38 2006
New Revision: 28234

Modified:
   pypy/dist/pypy/translator/tool/make_dot.py
   pypy/dist/pypy/translator/tool/pygame/graphdisplay.py
Log:
Slightly less verbose blocks in pygame graphs.


Modified: pypy/dist/pypy/translator/tool/make_dot.py
==============================================================================
--- pypy/dist/pypy/translator/tool/make_dot.py	(original)
+++ pypy/dist/pypy/translator/tool/make_dot.py	Sun Jun  4 12:02:38 2006
@@ -75,6 +75,7 @@
 
 
 class FlowGraphDotGen(DotGen):
+    VERBOSE = False
 
     def __init__(self, graphname, rankdir=None):
         DotGen.__init__(self, graphname.replace('.', '_'), rankdir)
@@ -106,7 +107,11 @@
         data = funcgraph.name
         if hasattr(funcgraph, 'source'):
             source = funcgraph.source
-            data += "\\n" + "\\l".join(source.split('\n'))
+            if self.VERBOSE:
+                data += "\\n"
+            else:
+                data = ""
+            data += "\\l".join(source.split('\n'))
         if hasattr(funcgraph, 'func'):
             self.func = funcgraph.func
 
@@ -142,12 +147,16 @@
             lines.append("exitswitch: %s" % block.exitswitch)
 
         iargs = " ".join(map(repr, block.inputargs))
-        if block.exc_handler:
-            eh = ' (EH)'
+        if self.VERBOSE:
+            if block.exc_handler:
+                eh = ' (EH)'
+            else:
+                eh = ''
+            data = "%s%s%s\\n" % (name, block.at(), eh)
         else:
-            eh = ''
-        data = "%s%s%s\\ninputargs: %s\\n\\n" % (name, block.at(), eh, iargs)
-        if block.operations and self.func:
+            data = "%s\\n" % (name,)
+        data += "inputargs: %s\\n\\n" % (iargs,)
+        if self.VERBOSE and block.operations and self.func:
             maxoffs = max([op.offset for op in block.operations])
             if maxoffs >= 0:
                 minoffs = min([op.offset for op in block.operations

Modified: pypy/dist/pypy/translator/tool/pygame/graphdisplay.py
==============================================================================
--- pypy/dist/pypy/translator/tool/pygame/graphdisplay.py	(original)
+++ pypy/dist/pypy/translator/tool/pygame/graphdisplay.py	Sun Jun  4 12:02:38 2006
@@ -682,7 +682,7 @@
 
 def shortlabel(label):
     """Shorten a graph node label."""
-    return label.replace('\\l', '').splitlines()[0]
+    return label.replace('\\l', '\n').splitlines()[0]
 
 
 def renderline(text, font, fgcolor, width, maxheight=sys.maxint,



More information about the Pypy-commit mailing list