Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
c7a269dd
Commit
c7a269dd
authored
Aug 06, 2003
by
Alexandre Duret-Lutz
Browse files
* wrap/python/cgi/ltl2tgba.in: Handle show_formula_dot and
show_formula_gif.
parent
fe2f7268
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
c7a269dd
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,
...
...
wrap/python/cgi/ltl2tgba.in
View file @
c7a269dd
#!@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
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment