From cfcc5e857bfea2125abba9d96236b980f67efdea Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 2 Feb 2004 22:04:38 +0000 Subject: [PATCH] * wrap/python/cgi/ltl2tgba.in: Import spot and redirect stderr to stdout early. --- ChangeLog | 3 +++ wrap/python/cgi/ltl2tgba.in | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 361db2f6b..db211db3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-02-02 Alexandre Duret-Lutz + * 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. diff --git a/wrap/python/cgi/ltl2tgba.in b/wrap/python/cgi/ltl2tgba.in index 427287ad0..f51e49bb4 100644 --- a/wrap/python/cgi/ltl2tgba.in +++ b/wrap/python/cgi/ltl2tgba.in @@ -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 "LTL-to-Büchi test" print "

Input

"