]> granicus.if.org Git - python/commitdiff
bpo-29920: Document cgitb.text() and cgitb.html() functions (GH-849)
authormasklinn <github.com@masklinn.net>
Fri, 5 May 2017 08:15:12 +0000 (10:15 +0200)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 5 May 2017 08:15:12 +0000 (11:15 +0300)
Doc/library/cgitb.rst

index b65a6355fe35133d42f94743893a23120678faf6..5f3a6476dd8cdcf5431425576ea14f3b0c638fd5 100644 (file)
@@ -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