Commit c7a269dd authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* wrap/python/cgi/ltl2tgba.in: Handle show_formula_dot and

show_formula_gif.
parent fe2f7268
2003-08-06 Alexandre Duret-Lutz <adl@gnu.org>
* wrap/python/cgi/ltl2tgba.in: Handle show_formula_dot and
show_formula_gif.
* src/ltlvisit/dotty.hh (dotty): Move the ostream argument first.
* src/ltlvisit/dump.hh (dump): Likewise.
* src/ltltest/equals.cc, src/ltltest/readltl.cc,
......
#!@PYTHON@
# -*- python -*-
import sys
import os
......@@ -6,7 +7,7 @@ import cgi
import cgitb; cgitb.enable()
sys.path.insert(0, '@pythondir@')
# Directory for temporary files (images and other auxiliary files).
# Directory for temporary files (images and other auxiliary files).
imgdir = 'spotimg'
# Cleanup stale files from our image directory.
......@@ -51,6 +52,8 @@ formula = form.getfirst('formula', '')
options = [
('show_parse', 'show traces during parsing', 0),
('show_formula_dot', 'print the formula as .dot', 0),
('show_formula_gif', 'draw the formula', 0),
('show_automaton_dot', 'print Bchi automaton as .dot', 0),
('show_automaton_gif', 'draw Bchi automaton', 1),
('show_degen_dot', 'print degeneralized Bchi automaton as .dot', 0),
......@@ -112,6 +115,22 @@ if err:
print "<p>Formula is<code>", f, "</code></p>"
if show_formula_dot:
print '<pre>'; sys.stdout.flush()
s = spot.ostringstream()
spot.dotty(s, f)
print cgi.escape(s.str())
del s
print '</pre>'; sys.stdout.flush()
if show_formula_gif:
outfile = spot.ofstream(imgprefix + '-f.dot')
spot.dotty(outfile, f)
del outfile
os.spawnlp(os.P_WAIT, 'dot', 'dot', '-Tgif', '-o',
imgprefix + '-f.gif', imgprefix + '-f.dot')
print '<img src="' + imgprefix + '-f.gif">'
print '<H2>Automaton</H2>'
dict = spot.bdd_dict()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment