[pypy-svn] r32583 - in pypy/dist/pypy: bin translator/tool/pygame

arigo at codespeak.net arigo at codespeak.net
Fri Sep 22 18:21:57 CEST 2006


Author: arigo
Date: Fri Sep 22 18:21:55 2006
New Revision: 32583

Modified:
   pypy/dist/pypy/bin/dotviewer.py
   pypy/dist/pypy/translator/tool/pygame/graphclient.py
Log:
Can pass directly .plain files to bin/dotviewer.py.


Modified: pypy/dist/pypy/bin/dotviewer.py
==============================================================================
--- pypy/dist/pypy/bin/dotviewer.py	(original)
+++ pypy/dist/pypy/bin/dotviewer.py	Fri Sep 22 18:21:55 2006
@@ -12,13 +12,15 @@
 
 usage = '''
         %s filename.dot
+        %s filename.plain
         %s hostname:port
         %s :port
 
 In the first form, show the graph contained in a .dot file.
+In the second form, the graph was already compiled to a .plain file.
 In the other forms, connect to a graph server like
 goal/translate.py.
-''' % (sys.argv[0], sys.argv[0], sys.argv[0])
+''' % (sys.argv[0], sys.argv[0], sys.argv[0], sys.argv[0])
 
 parser = optparse.OptionParser(usage=usage)
 parser.add_option("--reload", action="store_true", dest="reload",

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	Fri Sep 22 18:21:55 2006
@@ -18,7 +18,11 @@
 PLAIN_FILE = udir.join('graph.plain')
 
 def dot2plain(dotfile, plainfile, use_codespeak=False):
-    if not use_codespeak:
+    if str(dotfile).lower().endswith('.plain'):
+        # already a .plain file
+        plainfile = py.path.local(plainfile) 
+        plainfile.write(py.path.local(dotfile).read())
+    elif not use_codespeak:
         py.process.cmdexec('dot -Tplain %s>%s' % (dotfile, plainfile))
     elif 0: 
         gw = py.execnet.SshGateway('codespeak.net')



More information about the Pypy-commit mailing list