You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by jg...@apache.org on 2006/03/26 22:03:14 UTC
svn commit: r388951 - /httpd/mod_python/trunk/Doc/modpython6.tex
Author: jgallacher
Date: Sun Mar 26 12:03:13 2006
New Revision: 388951
URL: http://svn.apache.org/viewcvs?rev=388951&view=rev
Log:
Fixed more indentation issues in Doc/modpython6.tex code examples.
Modified:
httpd/mod_python/trunk/Doc/modpython6.tex
Modified: httpd/mod_python/trunk/Doc/modpython6.tex
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/Doc/modpython6.tex?rev=388951&r1=388950&r2=388951&view=diff
==============================================================================
--- httpd/mod_python/trunk/Doc/modpython6.tex (original)
+++ httpd/mod_python/trunk/Doc/modpython6.tex Sun Mar 26 12:03:13 2006
@@ -13,7 +13,7 @@
<Directory /some/path>
SetHandler mod_python
PythonHandler mod_python.publisher
- </Directory>
+ </Directory>
\end{verbatim}
This handler allows access to functions and variables within a module
@@ -24,7 +24,7 @@
""" Publisher example """
def say(req, what="NOTHING"):
- return "I am saying %s" % what
+ return "I am saying %s" % what
\end{verbatim}
@@ -87,8 +87,8 @@
DocumentRoot /some/dir
<Directory /some/dir>
- SetHandler mod_python
- PythonHandler mod_python.publisher
+ SetHandler mod_python
+ PythonHandler mod_python.publisher
</Directory>
\end{verbatim}
@@ -96,12 +96,11 @@
\begin{verbatim}
def index(req):
-
- return "We are in index()"
+ return "We are in index()"
def hello(req):
+ return "We are in hello()"
- return "We are in hello()"
\end{verbatim}
Then:
@@ -183,20 +182,20 @@
def __auth__(req, user, passwd):
- if user == "eggs" and passwd == "spam" or \
- user == "joe" and passwd == "eoj":
- return 1
- else:
- return 0
+ if user == "eggs" and passwd == "spam" or \
+ user == "joe" and passwd == "eoj":
+ return 1
+ else:
+ return 0
def __access__(req, user):
- if user == "eggs":
- return 1
- else:
- return 0
+ if user == "eggs":
+ return 1
+ else:
+ return 0
def hello(req):
- return "hello"
+ return "hello"
\end{verbatim}
@@ -209,7 +208,7 @@
__access__ = ["eggs"]
def hello(req):
- return "hello"
+ return "hello"
\end{verbatim}
@@ -220,16 +219,16 @@
\begin{verbatim}
def sensitive(req):
- def __auth__(req, user, password):
- if user == 'spam' and password == 'eggs':
- # let them in
- return 1
- else:
- # no access
- return 0
+ def __auth__(req, user, password):
+ if user == 'spam' and password == 'eggs':
+ # let them in
+ return 1
+ else:
+ # no access
+ return 0
- # something involving sensitive information
- return 'sensitive information`
+ # something involving sensitive information
+ return 'sensitive information`
\end{verbatim}
Note that this technique will also work if \code{__auth__} or