linkcheck.lc_cgi

Functions used by the WSGI script.

Functions

application(environ, start_response)

WSGI interface: start an URL check.

checkform(form, env)

Check form data.

checklink(form, env)

Validates the CGI form and checks the given links.

dump(env, form)

Log environment and form.

encode(s)

Encode given string in HTML encoding.

format_error(why)

Format standard error page.

formvalue(form, key)

Get value with given key from WSGI form.

get_configuration(form, out)

Initialize a CGI configuration.

get_host_name(form)

Return host name of given URL.

get_response_headers()

Get list of response headers in key-value form.

log(env, msg)

Log message to WSGI error output.

start_check(aggregate, out)

Start checking in background and write encoded output to out.

Classes

ThreadsafeIO()

Thread-safe unicode I/O class.

Exceptions

LCFormError

Form related errors.

exception linkcheck.lc_cgi.LCFormError[source]

Bases: Exception

Form related errors.

class linkcheck.lc_cgi.ThreadsafeIO[source]

Bases: object

Thread-safe unicode I/O class.

Initialize buffer.

close(**kwargs)[source]

Reset buffer and close this I/O object.

get_data(**kwargs)[source]

Get bufferd unicode data.

write(**kwargs)[source]

Write given unicode data to buffer.

linkcheck.lc_cgi.application(environ, start_response)[source]

WSGI interface: start an URL check.

linkcheck.lc_cgi.checkform(form, env)[source]

Check form data. throw exception on error Be sure to NOT print out any user-given data as HTML code, so use only plain strings as exception text.

Validates the CGI form and checks the given links.

linkcheck.lc_cgi.dump(env, form)[source]

Log environment and form.

linkcheck.lc_cgi.encode(s)[source]

Encode given string in HTML encoding.

linkcheck.lc_cgi.format_error(why)[source]

Format standard error page.

Parameters:

why (unicode) – error message

Returns:

HTML page content

Return type:

unicode

linkcheck.lc_cgi.formvalue(form, key)[source]

Get value with given key from WSGI form.

linkcheck.lc_cgi.get_configuration(form, out)[source]

Initialize a CGI configuration.

linkcheck.lc_cgi.get_host_name(form)[source]

Return host name of given URL.

linkcheck.lc_cgi.get_response_headers()[source]

Get list of response headers in key-value form.

linkcheck.lc_cgi.log(env, msg)[source]

Log message to WSGI error output.

linkcheck.lc_cgi.start_check(aggregate, out)[source]

Start checking in background and write encoded output to out.