From 5904255b14caa950330040f69e2b9ab6f176de1f Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 21 Apr 2004 19:32:37 +0000 Subject: [PATCH] * wrap/python/cgi/ltl2tgba.in (add_options): Revamp options output using this new function. --- ChangeLog | 3 ++ wrap/python/cgi/ltl2tgba.in | 60 +++++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38d101a4c..1031d8f1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-04-21 Alexandre Duret-Lutz + * wrap/python/cgi/ltl2tgba.in (add_options): Revamp options output + using this new function. + * wrap/python/spot.i: Process tgbaalgos/neverclaim.hh. * wrap/python/cgi/ltl2tgba.in: Display the never claim on demand. diff --git a/wrap/python/cgi/ltl2tgba.in b/wrap/python/cgi/ltl2tgba.in index 31b2b22cb..dd739ffa8 100644 --- a/wrap/python/cgi/ltl2tgba.in +++ b/wrap/python/cgi/ltl2tgba.in @@ -194,24 +194,23 @@ formula = form.getfirst('formula', '') color_fm = '#E0D8E0' color_lacim = "#F8D8E8" -options = [( - 'Common options', 0, '', [ +options_common = [ ('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_never_claim', 'output Spin never claim', 0), ('show_lbtt', 'convert automaton for LBTT', 0), - ]), ( - 'Debugging options', 0, '', [ + ] +options_debug = [ ('show_parse', 'show traces during parsing', 0), ('show_dictionnay', 'print BDD dictionary', 0), - ]), ( - 'Couvreur/FM options', 1, color_fm, [ + ] +options_trans_fm = [ ('opt_exprop', 'optimize determinism', 1), ('opt_symb_merge', 'merge states with same symbolic successor representation', 1), - ]), ( - 'Couvreur/LaCIM options', 1, color_lacim, [ + ] +options_trans_lacim = [ ('show_relation_set', 'print the transition relation as a BDD set', 0), ('show_relation_png', @@ -220,7 +219,7 @@ options = [( 'print the acceptance relation as a BDD set', 0), ('show_acceptance_png', 'draw the acceptance relation', 0), - ])] + ] default_translator = 'trans_fm'; translators = [ @@ -300,23 +299,14 @@ an indentifier: aUb is an atomic proposition, unlike column = [[], []] -column[0].append("Algorithm") -trans = form.getfirst("trans", default_translator) -for opt, desc, color in translators: - if trans == opt: - str = "checked" - else: - str = "" - globals()[opt] = str - s = '%s' - column[0].append(s % (color, opt, str, desc)) - -print """""" - -for opt_group, opt_column, opt_color, opt_list in options: +def add_options(opt_group, opt_column, opt_color, opt_list): if opt_color: opt_color = ' bgcolor="%s"' % opt_color - column[opt_column].append(("" % opt_color) + opt_group + "") + if opt_group: + column[opt_column].append(("" % opt_color) + opt_group + "") + prefix = '' + else: + prefix = '    ' for opt, desc, arg, in opt_list: if formula: val = int(form.getfirst(opt, 0)) @@ -327,8 +317,26 @@ for opt_group, opt_column, opt_color, opt_list in options: else: str = "" globals()[opt] = val - s = '%s' - column[opt_column].append(s % (opt_color, opt, str, desc)) + s = '%s%s' + column[opt_column].append((s % (opt_color, prefix, opt, str, desc))) + + +column[0].append("") +trans = form.getfirst("trans", default_translator) +for opt, desc, color in translators: + if trans == opt: + str = "checked" + else: + str = "" + globals()[opt] = str + s = '' + column[0].append(s % (color, opt, str, desc)) + add_options('', 0, color, globals()['options_' + opt]) + +print """
Algorithm%s
""" + +add_options("Common Options", 1, '', options_common) +add_options("Debugging Options", 1, '', options_debug) print '
' width = range(len(column))