* wrap/python/cgi/ltl2tgba.in: Import spot and redirect stderr

to stdout early.
This commit is contained in:
Alexandre Duret-Lutz 2004-02-02 22:04:38 +00:00
parent 59125b2a6c
commit cfcc5e857b
2 changed files with 14 additions and 9 deletions

View file

@ -1,5 +1,8 @@
2004-02-02 Alexandre Duret-Lutz <adl@gnu.org>
* wrap/python/cgi/ltl2tgba.in: Import spot and redirect stderr
to stdout early.
* wrap/python/cgi/ltl2tgba.in (print_stats): Compute and display
the number of acceptance conditions.

View file

@ -26,10 +26,21 @@ import os
import cgi
import cgitb; cgitb.enable()
print "Content-Type: text/html"
print
# Redirect stderr to stdout.
os.close(sys.stderr.fileno())
os.dup2(sys.stdout.fileno(), sys.stderr.fileno())
sys.path.insert(0, '@pythondir@')
# Directory for temporary files (images and other auxiliary files).
imgdir = 'spotimg'
import spot
import buddy
# Cleanup stale files from our image directory.
os.system('find ' + imgdir + ' -type f -amin +10 -print | xargs rm -f')
@ -105,15 +116,6 @@ def render_bdd(basename, dictionary, bdd):
render_dot(basename)
print "Content-Type: text/html"
print
os.close(sys.stderr.fileno())
os.dup2(sys.stdout.fileno(), sys.stderr.fileno())
import spot
import buddy
print "<TITLE>LTL-to-Büchi test</TITLE>"
print "<H1>Input</H1>"