def get_configuration(form, out):
    """Initialize a CGI configuration."""
    config = configuration.Configuration()
    config["recursionlevel"] = int(formvalue(form, "level"))
    config["logger"] = config.logger_new('html', fd=out, encoding=HTML_ENCODING)
    config["threads"] = 2
    if "anchors" in form:
        config["enabledplugins"].append("AnchorCheck")
    if "errors" not in form:
        config["verbose"] = True
    # avoid checking of local files or other nasty stuff
    pat = "!^%s$" % urlutil.safe_url_pattern
    config["externlinks"].append(get_link_pat(pat, strict=True))
    config.sanitize()
    return config
def get_configuration ( form , out ) : config = configuration . Configuration ( ) config [ "recursionlevel" ] = int ( formvalue ( form , "level" ) ) config [ "logger" ] = config . logger_new ( 'html' , fd = out , encoding = HTML_ENCODING ) config [ "threads" ] = 2 if "anchors" in form : config [ "enabledplugins" ] . append ( "AnchorCheck" ) if "errors" not in form : config [ "verbose" ] = True pat = "!^%s$" % urlutil . safe_url_pattern config [ "externlinks" ] . append ( get_link_pat ( pat , strict = True ) ) config . sanitize ( ) return config
Initialize a CGI configuration.