[Python-checkins] r69804 - in python/trunk/Doc: howto/webservers.rst library/cgi.rst library/cgitb.rst
georg.brandl
python-checkins at python.org
Fri Feb 20 09:22:22 CET 2009
Author: georg.brandl
Date: Fri Feb 20 09:22:21 2009
New Revision: 69804
Log:
At least separate imports from other statements.
Modified:
python/trunk/Doc/howto/webservers.rst
python/trunk/Doc/library/cgi.rst
python/trunk/Doc/library/cgitb.rst
Modified: python/trunk/Doc/howto/webservers.rst
==============================================================================
--- python/trunk/Doc/howto/webservers.rst (original)
+++ python/trunk/Doc/howto/webservers.rst Fri Feb 20 09:22:21 2009
@@ -99,7 +99,8 @@
# -*- coding: UTF-8 -*-
# enable debugging
- import cgitb; cgitb.enable()
+ import cgitb
+ cgitb.enable()
print "Content-Type: text/plain;charset=utf-8"
print
Modified: python/trunk/Doc/library/cgi.rst
==============================================================================
--- python/trunk/Doc/library/cgi.rst (original)
+++ python/trunk/Doc/library/cgi.rst Fri Feb 20 09:22:21 2009
@@ -67,16 +67,18 @@
module defines all sorts of names for its own use or for backward compatibility
that you don't want in your namespace.
-When you write a new script, consider adding the line::
+When you write a new script, consider adding these lines::
- import cgitb; cgitb.enable()
+ import cgitb
+ cgitb.enable()
This activates a special exception handler that will display detailed reports in
the Web browser if any errors occur. If you'd rather not show the guts of your
program to users of your script, you can have the reports saved to files
-instead, with a line like this::
+instead, with code like this::
- import cgitb; cgitb.enable(display=0, logdir="/tmp")
+ import cgitb
+ cgitb.enable(display=0, logdir="/tmp")
It's very helpful to use this feature during script development. The reports
produced by :mod:`cgitb` provide information that can save you a lot of time in
@@ -470,9 +472,10 @@
Fortunately, once you have managed to get your script to execute *some* code,
you can easily send tracebacks to the Web browser using the :mod:`cgitb` module.
-If you haven't done so already, just add the line::
+If you haven't done so already, just add the lines::
- import cgitb; cgitb.enable()
+ import cgitb
+ cgitb.enable()
to the top of your script. Then try running it again; when a problem occurs,
you should see a detailed report that will likely make apparent the cause of the
Modified: python/trunk/Doc/library/cgitb.rst
==============================================================================
--- python/trunk/Doc/library/cgitb.rst (original)
+++ python/trunk/Doc/library/cgitb.rst Fri Feb 20 09:22:21 2009
@@ -26,9 +26,10 @@
functions, to help you debug the problem. Optionally, you can save this
information to a file instead of sending it to the browser.
-To enable this feature, simply add one line to the top of your CGI script::
+To enable this feature, simply add this to the top of your CGI script::
- import cgitb; cgitb.enable()
+ import cgitb
+ cgitb.enable()
The options to the :func:`enable` function control whether the report is
displayed in the browser and whether the report is logged to a file for later
More information about the Python-checkins
mailing list