diff --git a/ChangeLog b/ChangeLog index 7da654ff0..aa63338ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-02-21 Alexandre Duret-Lutz + + * wrap/python/cgi/ltl2tgba.in: Color translators and their options. + 2004-02-20 Alexandre Duret-Lutz * wrap/python/cgi/ltl2tgba.in: Present the options in a table. diff --git a/wrap/python/cgi/ltl2tgba.in b/wrap/python/cgi/ltl2tgba.in index 4d48e3d4a..abad66ec1 100644 --- a/wrap/python/cgi/ltl2tgba.in +++ b/wrap/python/cgi/ltl2tgba.in @@ -38,12 +38,17 @@ sys.path.insert(0, '@pythondir@') # Directory for temporary files (images and other auxiliary files). imgdir = 'spotimg' +# Extra HTML headers. +extra_header = '' +# extra_header = '' + import spot import buddy def print_footer(): print '
' print 'ltl2tgba.py @PACKAGE_VERSION@; Spot', spot.version() + print '' # We want the script to kill itself whenever it run for more than 30 # seconds. `dot' can be very long at drawing huge graphs, and may @@ -161,31 +166,39 @@ def render_bdd(basename, dictionary, bdd): render_dot(basename) -print "LTL-to-Büchi test" -print """

Spot's on-line -LTL-to-Büchi translator

""" +print """ + + +Spot's on-line LTL-to-Buchi translator + +%s + +

Spot's on-line +LTL-to-Büchi translator

""" % extra_header formula = form.getfirst('formula', '') - +#F8F0E8 +color_fm = '#E0D8E0' +color_lacim = "#F8D8E8" options = [( - 'Common options', 0, [ + 'Common options', 0, '', [ ('show_formula_png', 'draw the formula', 0), ('show_automaton_png', 'draw Büchi automaton', 1), ('show_degen_png', 'draw degeneralized Büchi automaton', 0), ('show_lbtt', 'convert automaton for LBTT', 0), ]), ( - 'Debugging options', 0, [ + 'Debugging options', 0, '', [ ('show_parse', 'show traces during parsing', 0), ('show_dictionnay', 'print BDD dictionary', 0), ]), ( - 'Couvreur/FM options', 1, [ + 'Couvreur/FM options', 1, color_fm, [ ('opt_exprop', 'optimize determinism', 1), ('opt_symb_merge', 'merge states with same symbolic successor representation', 1), ]), ( - 'Couvreur/Lacim options', 1, [ + 'Couvreur/LaCIM options', 1, color_lacim, [ ('show_relation_set', 'print the transition relation as a BDD set', 0), ('show_relation_png', @@ -198,8 +211,8 @@ options = [( default_translator = 'trans_fm'; translators = [ - ('trans_fm', 'Convreur/FM'), - ('trans_lacim', 'Convreur/LaCIM'), + ('trans_fm', 'Couvreur/FM', color_fm), + ('trans_lacim', 'Couvreur/LaCIM', color_lacim), ] print ("""

@@ -276,19 +289,21 @@ column = [[], []] column[0].append("Algorithm") trans = form.getfirst("trans", default_translator) -for opt, desc, in translators: +for opt, desc, color in translators: if trans == opt: str = "checked" else: str = "" globals()[opt] = str - s = '%s' - column[0].append(s % (opt, str, desc)) + s = '%s' + column[0].append(s % (color, opt, str, desc)) print """""" -for opt_group, opt_column, opt_list in options: - column[opt_column].append("") +for opt_group, opt_column, opt_color, opt_list in options: + if opt_color: + opt_color = ' bgcolor="%s"' % opt_color + column[opt_column].append(("" % opt_color) + opt_group + "") for opt, desc, arg, in opt_list: if formula: val = int(form.getfirst(opt, 0)) @@ -299,8 +314,8 @@ for opt_group, opt_column, opt_list in options: else: str = "" globals()[opt] = val - s = '' - column[opt_column].append(s % (opt, str, desc)) + s = '%s' + column[opt_column].append(s % (opt_color, opt, str, desc)) print '
" + opt_group + "%s
' width = range(len(column))