def main():
    options = OptionsClass()
    options.load_defaults(defaults)

    # Create HTML page that outline the available options.
    output = open("experimental_options.ht", "w")
    keys = options._options.keys()
    keys.sort()
    output.write(table_header)
    for sect, opt_name in keys:
        doc = options._options[sect, opt_name].doc()
        if not doc.startswith("(EXPERIMENTAL)"):
            continue
        output.write('<tr style="height:1em">&nbsp;</tr>\n')
        opt = options.get_option(sect, opt_name)

        # Replace regex's with readable descriptions.
        if opt.allowed_values in nice_regex_names:
            replacement = nice_regex_names[opt.allowed_values]
            if replacement is None:
                continue
            opt.allowed_values = (replacement, )

        output.write(opt.as_documentation_string(sect).\
                     replace("(EXPERIMENTAL) ", ""))
        output.write('\n')
    output.write("</table>\n\n")
    output.close()

    # Create pre-filled configuration file with comments.
    output = open("experimental.ini", "w")
    keys = options._options.keys()
    keys.sort()
    currentSection = None
    for sect, opt in keys:
        doc = options._options[sect, opt].doc()
        if doc.startswith("(EXPERIMENTAL)"):
            doc = doc[15:]
        else:
            continue
        if sect != currentSection:
            if currentSection is not None:
                output.write('\n')
            output.write('[')
            output.write(sect)
            output.write("]\n")
            currentSection = sect
        if not doc:
            doc = "No information available, sorry."
        doc = re.sub(r"\s+", " ", doc)
        output.write("\n# %s\n" % ("\n# ".join(textwrap.wrap(doc)), ))
        options._options[sect, opt].write_config(output)
    output.close()
def main():
    options = OptionsClass()
    options.load_defaults(defaults)

    # Create HTML page that outline the available options.
    output = open("experimental_options.ht", "w")
    keys = options._options.keys()
    keys.sort()
    output.write(table_header)
    for sect, opt_name in keys:
        doc = options._options[sect, opt_name].doc()
        if not doc.startswith("(EXPERIMENTAL)"):
            continue
        output.write('<tr style="height:1em">&nbsp;</tr>\n')
        opt = options.get_option(sect, opt_name)

        # Replace regex's with readable descriptions.
        if opt.allowed_values in nice_regex_names:
            replacement = nice_regex_names[opt.allowed_values]
            if replacement is None:
                continue
            opt.allowed_values = (replacement,)

        output.write(opt.as_documentation_string(sect).\
                     replace("(EXPERIMENTAL) ", ""))
        output.write('\n')
    output.write("</table>\n\n")
    output.close()

    # Create pre-filled configuration file with comments.
    output = open("experimental.ini", "w")
    keys = options._options.keys()
    keys.sort()
    currentSection = None
    for sect, opt in keys:
        doc = options._options[sect, opt].doc()
        if doc.startswith("(EXPERIMENTAL)"):
            doc = doc[15:]
        else:
            continue
        if sect != currentSection:
            if currentSection is not None:
                output.write('\n')
            output.write('[')
            output.write(sect)
            output.write("]\n")
            currentSection = sect
        if not doc:
            doc = "No information available, sorry."
        doc = re.sub(r"\s+", " ", doc)
        output.write("\n# %s\n" % ("\n# ".join(textwrap.wrap(doc)),))
        options._options[sect, opt].write_config(output)
    output.close()