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()
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
except:
pass
-#def phrase(A,I,K):
-# return chart['phrase/3']
-
from IPython import embed; embed()