]> hydra-www.ietfng.org Git - dyna2/commitdiff
tweaks to python code.
authortimv <tim.f.vieira@gmail.com>
Thu, 13 Dec 2012 18:53:15 +0000 (13:53 -0500)
committertimv <tim.f.vieira@gmail.com>
Thu, 13 Dec 2012 18:53:15 +0000 (13:53 -0500)
bin/prototype.py
bin/stdlib.py

index bc45fcd0da44ce8f01333da19c2fcfeb6d7faccf..23c670e7b12126b274277ec760b16b67290a3676 100644 (file)
@@ -100,12 +100,12 @@ class Hypergraph(object):
 
             print >> f, '}'
 
-        print 'wrote', dot, 'compiling...'
+#        print 'wrote', dot, 'compiling...'
 
         # run graphviz to produce image
         assert 0 == os.system('(dot -Tsvg %s > %s)' % (dot, svg)), 'graphviz failed.'
 
-        print 'created', svg
+#        print 'created', svg
 
         with file(svg) as f:
             return f.read()
index 2b4726d257a280cae2c6e40fbd8b769e0da58a63..f2f904a752679db480ddf3c117693dde529dd0c5 100644 (file)
@@ -284,8 +284,12 @@ def go():
         with file(dyna + '.chart', 'wb') as f:
             dump_charts(f)
 
+try:
+    [dyna] = sys.argv[1:]
+except ValueError:
+    print 'Dyna interpreter:\n\tplease specify a source file.'
+    sys.exit(1)
 
-[dyna] = sys.argv[1:]
 
 cmd = """ghc -isrc Dyna.Backend.Python -e 'processFile "%s"' """ % dyna
 assert 0 == os.system(cmd), 'command failed:\n\t' + cmd
@@ -360,7 +364,4 @@ for _fn in chart:
     except:
         pass
 
-#def phrase(A,I,K):
-#    return chart['phrase/3']
-
 from IPython import embed; embed()