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

arigo at codespeak.net arigo at codespeak.net
Wed Jun 29 20:35:16 CEST 2005


Author: arigo
Date: Wed Jun 29 20:35:14 2005
New Revision: 14013

Modified:
   pypy/dist/pypy/translator/tool/graphpage.py
   pypy/dist/pypy/translator/tool/pygame/drawgraph.py
   pypy/dist/pypy/translator/tool/pygame/graphclient.py
Log:
- Some crash-proofing of the pygame viewer.
- Simplified a bit the displayed text for variables after typing (removed the
  annotation, showing only the low-level type).


Modified: pypy/dist/pypy/translator/tool/graphpage.py
==============================================================================
--- pypy/dist/pypy/translator/tool/graphpage.py	(original)
+++ pypy/dist/pypy/translator/tool/graphpage.py	Wed Jun 29 20:35:14 2005
@@ -133,8 +133,9 @@
                 return
             for var in vars:
                 if hasattr(var, 'concretetype'):
-                    info = self.links.get(var.name, var.name)
-                    info = '(%s) %s' % (var.concretetype, info)
+                    #info = self.links.get(var.name, var.name)
+                    #info = '(%s) %s' % (var.concretetype, info)
+                    info = str(var.concretetype)
                     self.links[var.name] = info
         for graph in graphs:
             traverse(visit, graph)

Modified: pypy/dist/pypy/translator/tool/pygame/drawgraph.py
==============================================================================
--- pypy/dist/pypy/translator/tool/pygame/drawgraph.py	(original)
+++ pypy/dist/pypy/translator/tool/pygame/drawgraph.py	Wed Jun 29 20:35:14 2005
@@ -230,7 +230,7 @@
     def getfont(self, size):
         if size in self.FONTCACHE:
             return self.FONTCACHE[size]
-        elif size < 4:
+        elif size < 5:
             self.FONTCACHE[size] = None
             return None
         else:

Modified: pypy/dist/pypy/translator/tool/pygame/graphclient.py
==============================================================================
--- pypy/dist/pypy/translator/tool/pygame/graphclient.py	(original)
+++ pypy/dist/pypy/translator/tool/pygame/graphclient.py	Wed Jun 29 20:35:14 2005
@@ -35,11 +35,17 @@
         import urllib
         content = py.path.local(dotfile).read()
         request = urllib.urlencode({'dot': content})
-        urllib.urlretrieve('http://codespeak.net/pypy/convertdot.cgi',
-                           str(plainfile),
-                           data=request)
-        plainfile = py.path.local(plainfile)
-        if not plainfile.check(file=1) or not plainfile.read().startswith('graph '):
+        try:
+            urllib.urlretrieve('http://codespeak.net/pypy/convertdot.cgi',
+                               str(plainfile),
+                               data=request)
+        except IOError:
+            success = False
+        else:
+            plainfile = py.path.local(plainfile)
+            success = (plainfile.check(file=1) and
+                       plainfile.read().startswith('graph '))
+        if not success:
             print "NOTE: failed to use codespeak's convertdot.cgi, trying local 'dot'"
             cmdexec('dot -Tplain %s>%s' % (dotfile, plainfile))
 



More information about the Pypy-commit mailing list