diff options
author | masklinn <github.com@masklinn.net> | 2017-05-05 08:15:12 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2017-05-05 08:15:12 (GMT) |
commit | c07b3a15be5e0a68a73b4c532861ed8de6932bd2 (patch) | |
tree | 40bda0b0713dd08fc0aaae42515fd112d49da5a4 /Doc/library/cgitb.rst | |
parent | fdaeea620f8c78da89cddba4ab010c64535800e0 (diff) | |
download | cpython-c07b3a15be5e0a68a73b4c532861ed8de6932bd2.zip cpython-c07b3a15be5e0a68a73b4c532861ed8de6932bd2.tar.gz cpython-c07b3a15be5e0a68a73b4c532861ed8de6932bd2.tar.bz2 |
bpo-29920: Document cgitb.text() and cgitb.html() functions (GH-849)
Diffstat (limited to 'Doc/library/cgitb.rst')
-rw-r--r-- | Doc/library/cgitb.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/cgitb.rst b/Doc/library/cgitb.rst index b65a635..5f3a647 100644 --- a/Doc/library/cgitb.rst +++ b/Doc/library/cgitb.rst @@ -54,6 +54,24 @@ analysis. value forces plain text output. The default value is ``"html"``. +.. function:: text(info, context=5) + + This function handles the exception described by *info* (a 3-tuple containing + the result of :func:`sys.exc_info`), formatting its traceback as text and + returning the result as a string. The optional argument *context* is the + number of lines of context to display around the current line of source code + in the traceback; this defaults to ``5``. + + +.. function:: html(info, context=5) + + This function handles the exception described by *info* (a 3-tuple containing + the result of :func:`sys.exc_info`), formatting its traceback as HTML and + returning the result as a string. The optional argument *context* is the + number of lines of context to display around the current line of source code + in the traceback; this defaults to ``5``. + + .. function:: handler(info=None) This function handles an exception using the default settings (that is, show a |