diff --git a/Doc/Makefile.in b/Doc/Makefile.in index d13e703a0bc23ddcb277423c453c347f7f37190d..2bac29fd52b3ac38444958a1c6eb9626d32df0c8 100644 --- a/Doc/Makefile.in +++ b/Doc/Makefile.in @@ -16,7 +16,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) .PHONY: help checkout update build html htmlhelp latex text changes linkcheck \ - suspicious coverage htmlview distclean clean dist check serve \ + suspicious coverage htmlview clean dist check serve \ autobuild-dev autobuild-stable help: @@ -102,8 +102,6 @@ coverage: build htmlview: html $(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')" -distclean: clean - clean: -rm -rf build/* -rm -rf tools/sphinx @@ -111,6 +109,9 @@ clean: -rm -rf tools/jinja2 -rm -rf tools/docutils +distclean: clean + rm -f Makefile + dist: rm -rf dist mkdir -p dist diff --git a/Doc/changes.rst b/Doc/changes.rst index aa4dfdd0fd26990f6c7a4b1258040c73a114e21f..8b20d37cd06121664f825f1b798fc3b4540e60ff 100644 --- a/Doc/changes.rst +++ b/Doc/changes.rst @@ -5,22 +5,6 @@ Changes ******* -.. _changes_from_3_4_1: - -Changes from version 3.4.1 -========================== - -New Features ------------- - -* Support for Python 3.3 - -Improvements ------------- - -* Simpler, faster and up-to-date with latest Python code for creating/maintaining interpreter and thread state. -* A much faster WSGI implementation (start_response now implemented in C) - .. _changes_from_3_3_1: Changes from version 3.3.1 diff --git a/Doc/commandline.rst b/Doc/commandline.rst index e2a31ca0c54c26089fa19ffb1195f8c5d8862824..7b44ab3b33c4351674a5879c6721ae77e21a5c2e 100644 --- a/Doc/commandline.rst +++ b/Doc/commandline.rst @@ -122,13 +122,10 @@ WSGI application which is located in ``/path/to/myapp`` and defined in The above example will create a Python-based configuration in ``/path/to/new/server_root/conf/http_conf.py`` which is a simple -Pythong script. When executed, the output of the script becomes an +Python script. When executed, the output of the script becomes an Apache configuration (``create`` will take care of generating the -first Apache config for you). +first Apache config for you). You should be able to run this Apache instance by executing:: mod_python start /path/to/new/server_root/conf/httpd.conf - - - diff --git a/Doc/pythonapi.rst b/Doc/pythonapi.rst index 61d78f20443eb031683f25bc59b3d9aa1d263598..5eb051e0a3cef991d4c69f420986e2e1f58d1195 100644 --- a/Doc/pythonapi.rst +++ b/Doc/pythonapi.rst @@ -145,6 +145,7 @@ Every handler can return: HTTP_UNSUPPORTED_MEDIA_TYPE = 415 HTTP_RANGE_NOT_SATISFIABLE = 416 HTTP_EXPECTATION_FAILED = 417 + HTTP_IM_A_TEAPOT = 418 HTTP_UNPROCESSABLE_ENTITY = 422 HTTP_LOCKED = 423 HTTP_FAILED_DEPENDENCY = 424 diff --git a/NEWS b/NEWS index ce845ccdf55cac1ca5a60be29a69ee1f6698e1d6..198fa665af4b27c557d9b56ba5b2c8983dadd350 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +Nov 13 2013 - 3.5.0 released + Oct 22 2013 - 3.4.1 released Jan 29 2007 - 3.3.1 is being tagged diff --git a/configure b/configure index cee5b6affed0f47c258a56d1b3ddfb507d763583..b12a29fa02a717b127c0f4645d51c36e63ebb3e8 100755 --- a/configure +++ b/configure @@ -1,18 +1,20 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -20,23 +22,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -44,7 +38,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -55,7 +55,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -78,13 +78,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -94,15 +87,16 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -114,12 +108,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -131,330 +129,343 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - # CDPATH. -$as_unset CDPATH - - +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST else - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : -if as_func_ret_success; then - : else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi done;; esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } IFS=$as_save_IFS - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break fi - fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -fi -fi +} # as_fn_mkdir_p +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error -exitcode=0 -if as_func_success; then - : +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. + as_expr=false fi -if as_func_ret_success; then - : +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. + as_basename=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -471,9 +482,12 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -482,29 +496,18 @@ test \$exitcode = 0") || { exit } - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -519,49 +522,29 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -570,11 +553,11 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -exec 7<&0 </dev/null 6>&1 +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -589,7 +572,6 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= @@ -597,6 +579,7 @@ PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= +PACKAGE_URL= ac_unique_file="src/mod_python.c" ac_subst_vars='LTLIBOBJS @@ -654,6 +637,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -665,6 +649,7 @@ bindir program_transform_name prefix exec_prefix +PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -728,6 +713,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -752,8 +738,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -798,8 +785,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -825,8 +811,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -981,6 +966,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1030,8 +1024,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1047,8 +1040,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1078,17 +1070,17 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1097,7 +1089,7 @@ Try \`$0 --help' for more information." >&2 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1105,15 +1097,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1122,7 +1112,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1136,8 +1126,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1151,8 +1140,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1167,11 +1154,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1210,13 +1195,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1256,7 +1239,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1282,6 +1265,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1308,7 +1292,7 @@ if test -n "$ac_init_help"; then Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-apxs=NAME name of the apxs executable [apxs] + --with-apxs=NAME name of the apxs executable [[apxs]] --with-apache=DIR Path to Apache sources --with-python=PATH Path to specific Python binary --with-mutex-dir=DIR Mutex directory @@ -1325,12 +1309,13 @@ Some influential environment variables: LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. +Report bugs to the package provider. _ACEOF ac_status=$? fi @@ -1394,21 +1379,108 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.63 +generated by GNU Autoconf 2.69 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1444,8 +1516,8 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS } >&5 @@ -1482,9 +1554,9 @@ do ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1500,13 +1572,13 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1518,11 +1590,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -1531,13 +1601,13 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -1556,11 +1626,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -1573,11 +1641,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -1591,11 +1657,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -1609,46 +1673,53 @@ _ASBOX exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h +$as_echo "/* confdefs.h */" > confdefs.h + # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -1659,19 +1730,23 @@ fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; @@ -1679,7 +1754,7 @@ $as_echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1694,11 +1769,11 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; @@ -1708,17 +1783,17 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac @@ -1730,35 +1805,20 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi - - - - - - - - - - - - - - - - +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1779,9 +1839,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -1792,24 +1852,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1819,9 +1879,9 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -1832,24 +1892,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1858,7 +1918,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -1872,9 +1932,9 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -1885,24 +1945,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1912,9 +1972,9 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -1926,18 +1986,18 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -1956,10 +2016,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -1971,9 +2031,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -1984,24 +2044,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2015,9 +2075,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2028,24 +2088,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2058,7 +2118,7 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -2069,57 +2129,37 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2135,8 +2175,8 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: @@ -2152,17 +2192,17 @@ do done rm -f $ac_rmfiles -if { (ac_try="$ac_link_default" +if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2179,7 +2219,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2198,84 +2238,41 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - fi -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" +if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2290,32 +2287,83 @@ for ac_file in conftest.exe conftest conftest.*; do esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi - -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2327,17 +2375,17 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -2350,31 +2398,23 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2388,37 +2428,16 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -2427,20 +2446,16 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2451,35 +2466,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2490,36 +2481,12 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : - ac_c_werror_flag=$ac_save_c_werror_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2530,42 +2497,17 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -2582,23 +2524,18 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -2643,39 +2580,16 @@ main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -2686,17 +2600,19 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2709,9 +2625,9 @@ for ac_prog in ar aal do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -2722,24 +2638,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:$LINENO: result: $AR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2765,9 +2681,7 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2793,10 +2707,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2804,11 +2718,11 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2816,7 +2730,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2845,7 +2759,7 @@ case $as_dir/ in ;; esac -done + done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir @@ -2861,7 +2775,7 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -2872,11 +2786,11 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2884,7 +2798,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -2894,30 +2808,25 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi - -{ $as_echo "$as_me:$LINENO: checking for main in -lm" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 $as_echo_n "checking for main in -lm... " >&6; } -if test "${ac_cv_lib_m_main+set}" = set; then +if ${ac_cv_lib_m_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -2929,43 +2838,18 @@ return main (); return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_main=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_m_main=no + ac_cv_lib_m_main=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 $as_echo "$ac_cv_lib_m_main" >&6; } -if test "x$ac_cv_lib_m_main" = x""yes; then +if test "x$ac_cv_lib_m_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -2976,26 +2860,22 @@ fi -{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -3012,8 +2892,9 @@ main () ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; @@ -3029,10 +2910,10 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; @@ -3045,53 +2926,30 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_const=no + ac_cv_c_const=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -cat >>confdefs.h <<\_ACEOF -#define const /**/ -_ACEOF +$as_echo "#define const /**/" >>confdefs.h fi ### humor lowers blood pressure -{ $as_echo "$as_me:$LINENO: checking your blood pressure" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking your blood pressure" >&5 $as_echo_n "checking your blood pressure... " >&6; } -{ $as_echo "$as_me:$LINENO: result: a bit high, but we can proceed" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: a bit high, but we can proceed" >&5 $as_echo "a bit high, but we can proceed" >&6; } ## The goal is to find apxs -{ $as_echo "$as_me:$LINENO: checking whether apxs is available..." >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether apxs is available..." >&5 $as_echo "$as_me: checking whether apxs is available..." >&6;} @@ -3100,7 +2958,7 @@ $as_echo "$as_me: checking whether apxs is available..." >&6;} # check for --with-apxs # Check whether --with-apxs was given. -if test "${with_apxs+set}" = set; then +if test "${with_apxs+set}" = set; then : withval=$with_apxs; APXS="$with_apxs" fi @@ -3110,9 +2968,9 @@ if test -z "${APXS}"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_APXS+set}" = set; then +if ${ac_cv_path_APXS+:} false; then : $as_echo_n "(cached) " >&6 else case $APXS in @@ -3126,14 +2984,14 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_APXS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -3141,10 +2999,10 @@ esac fi APXS=$ac_cv_path_APXS if test -n "$APXS"; then - { $as_echo "$as_me:$LINENO: result: $APXS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $APXS" >&5 $as_echo "$APXS" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3162,9 +3020,9 @@ fi if test -z "$APXS"; then - { $as_echo "$as_me:$LINENO: WARNING: **** apxs was not found, DSO compilation will not be available." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** apxs was not found, DSO compilation will not be available." >&5 $as_echo "$as_me: WARNING: **** apxs was not found, DSO compilation will not be available." >&2;} - { $as_echo "$as_me:$LINENO: WARNING: **** You can use --with-apxs to specify where your apxs is." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: **** You can use --with-apxs to specify where your apxs is." >&5 $as_echo "$as_me: WARNING: **** You can use --with-apxs to specify where your apxs is." >&2;} DSO="no_dso" ALL="static" @@ -3173,42 +3031,40 @@ else ALL="dso" # check Apache version - { $as_echo "$as_me:$LINENO: checking Apache version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Apache version" >&5 $as_echo_n "checking Apache version... " >&6; } HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`" HTTPD_VERSION=`$HTTPD -v | awk '/version/ {print $3}' | awk -F/ '{print $2}' | awk '{print $1}'` APR_VERSION=`${APXS} -q APR_VERSION` - { $as_echo "$as_me:$LINENO: result: $HTTPD_VERSION" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HTTPD_VERSION" >&5 $as_echo "$HTTPD_VERSION" >&6; } # make sure version begins with 2 if test -z "`echo $HTTPD_VERSION | egrep \^2`"; then - { { $as_echo "$as_me:$LINENO: error: This version of mod_python only works with Apache 2. The one we have ($HTTPD) seems to be $HTTPD_VERSION." >&5 -$as_echo "$as_me: error: This version of mod_python only works with Apache 2. The one we have ($HTTPD) seems to be $HTTPD_VERSION." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "This version of mod_python only works with Apache 2. The one we have ($HTTPD) seems to be $HTTPD_VERSION." "$LINENO" 5 fi # determine LIBEXEC - { $as_echo "$as_me:$LINENO: checking for Apache libexec directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Apache libexec directory" >&5 $as_echo_n "checking for Apache libexec directory... " >&6; } LIBEXECDIR=`${APXS} -q LIBEXECDIR` - { $as_echo "$as_me:$LINENO: result: $LIBEXECDIR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBEXECDIR" >&5 $as_echo "$LIBEXECDIR" >&6; } # determine INCLUDES - { $as_echo "$as_me:$LINENO: checking for Apache include directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Apache include directory" >&5 $as_echo_n "checking for Apache include directory... " >&6; } AP_INCLUDES="-I`${APXS} -q INCLUDEDIR`" - { $as_echo "$as_me:$LINENO: result: $AP_INCLUDES" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AP_INCLUDES" >&5 $as_echo "$AP_INCLUDES" >&6; } if test "`uname`" = "SunOS"; then - { $as_echo "$as_me:$LINENO: checking for gcc on Solaris possible missing _eprintf problem" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc on Solaris possible missing _eprintf problem" >&5 $as_echo_n "checking for gcc on Solaris possible missing _eprintf problem... " >&6; } if test "$CC" = "gcc"; then SOLARIS_HACKS="_eprintf.o _floatdidf.o _muldi3.o" fi - { $as_echo "$as_me:$LINENO: result: \"done\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"done\"" >&5 $as_echo "\"done\"" >&6; } fi @@ -3222,24 +3078,20 @@ fi ##AC_MSG_CHECKING(for --with-apache) # Check whether --with-apache was given. -if test "${with_apache+set}" = set; then +if test "${with_apache+set}" = set; then : withval=$with_apache; # temporarily disable static on 2.0 until I figure out how to # do it right - { { $as_echo "$as_me:$LINENO: error: Sorry, --with-apache (static compilation) is not supported at this time!" >&5 -$as_echo "$as_me: error: Sorry, --with-apache (static compilation) is not supported at this time!" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Sorry, --with-apache (static compilation) is not supported at this time!" "$LINENO" 5 AP_SRC=`cd $withval; pwd` if test ! -f "$AP_SRC/include/httpd.h"; then - { { $as_echo "$as_me:$LINENO: error: $withval does not look like an Apache 2.0 source directory." >&5 -$as_echo "$as_me: error: $withval does not look like an Apache 2.0 source directory." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "$withval does not look like an Apache 2.0 source directory." "$LINENO" 5 fi - { $as_echo "$as_me:$LINENO: result: $AP_SRC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AP_SRC" >&5 $as_echo "$AP_SRC" >&6; } AP_INCLUDES="-I${AP_SRC}/src/include -I${AP_SRC}/src/os/unix" @@ -3261,24 +3113,22 @@ else fi if test "$STATIC" = "no_static" -a "$DSO" = "no_dso"; then - { { $as_echo "$as_me:$LINENO: error: Neither static nor DSO option available, there is no point in continuing." >&5 -$as_echo "$as_me: error: Neither static nor DSO option available, there is no point in continuing." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Neither static nor DSO option available, there is no point in continuing." "$LINENO" 5 fi -{ $as_echo "$as_me:$LINENO: checking for --with-python" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-python" >&5 $as_echo_n "checking for --with-python... " >&6; } # Check whether --with-python was given. -if test "${with_python+set}" = set; then +if test "${with_python+set}" = set; then : withval=$with_python; PYTHON_BIN="$withval" - { $as_echo "$as_me:$LINENO: result: $PYTHON_BIN" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BIN" >&5 $as_echo "$PYTHON_BIN" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3287,9 +3137,9 @@ fi if test -z "$PYTHON_BIN"; then # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON_BIN+set}" = set; then +if ${ac_cv_path_PYTHON_BIN+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON_BIN in @@ -3302,14 +3152,14 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON_BIN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -3317,52 +3167,40 @@ esac fi PYTHON_BIN=$ac_cv_path_PYTHON_BIN if test -n "$PYTHON_BIN"; then - { $as_echo "$as_me:$LINENO: result: $PYTHON_BIN" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BIN" >&5 $as_echo "$PYTHON_BIN" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$PYTHON_BIN"; then - { { $as_echo "$as_me:$LINENO: error: python binary not found in path" >&5 -$as_echo "$as_me: error: python binary not found in path" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "python binary not found in path" "$LINENO" 5 fi fi # find out python version -{ $as_echo "$as_me:$LINENO: checking Python version" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5 $as_echo_n "checking Python version... " >&6; } PyVERSION=`$PYTHON_BIN -c 'import sys; print(sys.version[:3])'` PyMAJVERSION=`$PYTHON_BIN -c 'import sys; print(sys.version[:1])'` PyMINVERSION=`$PYTHON_BIN -c 'import sys; print(sys.version.split(".")[1])'` -{ $as_echo "$as_me:$LINENO: result: $PyVERSION" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PyVERSION" >&5 $as_echo "$PyVERSION" >&6; } -if test -z "$PyMAJVERSION"; then - { { $as_echo "$as_me:$LINENO: error: Unable to get Python version - is your Python working?" >&5 -$as_echo "$as_me: error: Unable to get Python version - is your Python working?" >&2;} - { (exit 1); exit 1; }; } -fi + # make sure Python version is >= 2.6 for 2 and >= 3.3 for 3 if test "$PyMAJVERSION" -lt "2"; then - { { $as_echo "$as_me:$LINENO: error: This version of mod_python only works with Python major version 2 or higher. The one you have seems to be $PyVERSION." >&5 -$as_echo "$as_me: error: This version of mod_python only works with Python major version 2 or higher. The one you have seems to be $PyVERSION." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "This version of mod_python only works with Python major version 2 or higher. The one you have seems to be $PyVERSION." "$LINENO" 5 fi if test "$PyMAJVERSION" -eq "2"; then if test "$PyMINVERSION" -lt "6"; then - { { $as_echo "$as_me:$LINENO: error: This version of mod_python only works with Python 2.x version 2.6 or higher. The one you have seems to be $PyVERSION." >&5 -$as_echo "$as_me: error: This version of mod_python only works with Python 2.x version 2.6 or higher. The one you have seems to be $PyVERSION." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "This version of mod_python only works with Python 2.x version 2.6 or higher. The one you have seems to be $PyVERSION." "$LINENO" 5 fi fi if test "$PyMAJVERSION" -eq "3"; then if test "$PyMINVERSION" -lt "3"; then - { { $as_echo "$as_me:$LINENO: error: This version of mod_python only works with Python 3.x version 3.3 or higher. The one you have seems to be $PyVERSION." >&5 -$as_echo "$as_me: error: This version of mod_python only works with Python 3.x version 3.3 or higher. The one you have seems to be $PyVERSION." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "This version of mod_python only works with Python 3.x version 3.3 or higher. The one you have seems to be $PyVERSION." "$LINENO" 5 fi fi @@ -3394,12 +3232,21 @@ if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then standard_lib=1) +"/config")'` LDFLAGS="${LDFLAGS1} ${LDFLAGS2}" - if test "$PyMAJVERSION" -eq "3"; then - PyLDVERSION=`$PYTHON_BIN -c 'from distutils import sysconfig; print(sysconfig.get_config_var("LDVERSION"))'` - LDLIBS1="-lpython${PyLDVERSION}" - else - LDLIBS1="-lpython${PyVERSION}" - fi + PYTHON_CODE=$(cat <<END +import distutils.sysconfig +lookingFor = "-lpython" +ret = str(distutils.sysconfig.get_config_var("BLDLIBRARY")) +if lookingFor not in ret: + cfg = distutils.sysconfig.get_config_vars() + for key in cfg: + if isinstance(cfg[key], str) and lookingFor in cfg[key]: + ret = cfg[key] + break +print(ret[ret.find(lookingFor) if ret.find(lookingFor) != -1 else 0:]) +END +) + + LDLIBS1=`${PYTHON_BIN} -c "$PYTHON_CODE"` LDLIBS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ print(sysconfig.get_config_var("LIBS"))'` @@ -3447,18 +3294,18 @@ TEST_MOD_PYTHON_SO="`pwd`/src/mod_python.so" # configure the MUTEX_DIR for location of mutex locks -{ $as_echo "$as_me:$LINENO: checking for --with-mutex-dir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-mutex-dir" >&5 $as_echo_n "checking for --with-mutex-dir... " >&6; } # Check whether --with-mutex-dir was given. -if test "${with_mutex_dir+set}" = set; then +if test "${with_mutex_dir+set}" = set; then : withval=$with_mutex_dir; MUTEX_DIR="$withval" - { $as_echo "$as_me:$LINENO: result: $MUTEX_DIR" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MUTEX_DIR" >&5 $as_echo "$MUTEX_DIR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3467,23 +3314,23 @@ if test -z "$MUTEX_DIR"; then MUTEX_DIR="/tmp" fi # TODO - check if MUTEX_DIR is an absolute path -{ $as_echo "$as_me:$LINENO: result: Using MUTEX_DIR $MUTEX_DIR" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using MUTEX_DIR $MUTEX_DIR" >&5 $as_echo "Using MUTEX_DIR $MUTEX_DIR" >&6; } # configure the MAX_LOCKS for number of mutex locks -{ $as_echo "$as_me:$LINENO: checking for --with-max-locks" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-max-locks" >&5 $as_echo_n "checking for --with-max-locks... " >&6; } # Check whether --with-max-locks was given. -if test "${with_max_locks+set}" = set; then +if test "${with_max_locks+set}" = set; then : withval=$with_max_locks; MAX_LOCKS="$withval" - { $as_echo "$as_me:$LINENO: result: $MAX_LOCKS" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAX_LOCKS" >&5 $as_echo "$MAX_LOCKS" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3491,7 +3338,7 @@ fi if test -z "$MAX_LOCKS"; then MAX_LOCKS="8" fi -{ $as_echo "$as_me:$LINENO: result: Using $MAX_LOCKS MAX_LOCKS." >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $MAX_LOCKS MAX_LOCKS." >&5 $as_echo "Using $MAX_LOCKS MAX_LOCKS." >&6; } # Check for correct flex version @@ -3499,18 +3346,18 @@ $as_echo "Using $MAX_LOCKS MAX_LOCKS." >&6; } # See README for more details -{ $as_echo "$as_me:$LINENO: checking for --with-flex" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-flex" >&5 $as_echo_n "checking for --with-flex... " >&6; } # Check whether --with-flex was given. -if test "${with_flex+set}" = set; then +if test "${with_flex+set}" = set; then : withval=$with_flex; LEX="$withval" - { $as_echo "$as_me:$LINENO: result: $LEX" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3519,9 +3366,9 @@ fi if test -z "$LEX"; then # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LEX+set}" = set; then +if ${ac_cv_path_LEX+:} false; then : $as_echo_n "(cached) " >&6 else case $LEX in @@ -3534,14 +3381,14 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -3549,10 +3396,10 @@ esac fi LEX=$ac_cv_path_LEX if test -n "$LEX"; then - { $as_echo "$as_me:$LINENO: result: $LEX" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3560,21 +3407,21 @@ fi fi if test "$LEX" && test -x "$LEX"; then - { $as_echo "$as_me:$LINENO: result: found $LEX, we'll use this. Use --with-flex to specify another." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $LEX, we'll use this. Use --with-flex to specify another." >&5 $as_echo "found $LEX, we'll use this. Use --with-flex to specify another." >&6; } - { $as_echo "$as_me:$LINENO: checking flex version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking flex version" >&5 $as_echo_n "checking flex version... " >&6; } FlexVERSION=`$LEX --version | sed 's/version//g' | awk '/flex/ {print $2}'` - Flex_MAJOR=`echo $FlexVERSION| awk -F . '{print $1}'` - Flex_MINOR=`echo $FlexVERSION| awk -F . '{print $2}'` - Flex_PATCH=`echo $FlexVERSION| awk -F . '{print $3}'` + Flex_MAJOR=`echo $FlexVERSION| awk -F. '{print $1}'` + Flex_MINOR=`echo $FlexVERSION| awk -F. '{print $2}'` + Flex_PATCH=`echo $FlexVERSION| awk -F. '{print $3}'` if test "$Flex_MAJOR" -eq "2" && test "$Flex_MINOR" -eq "5" && test "$Flex_PATCH" -ge "31"; then - { $as_echo "$as_me:$LINENO: result: $FlexVERSION. Good" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FlexVERSION. Good" >&5 $as_echo "$FlexVERSION. Good" >&6; } else - { $as_echo "$as_me:$LINENO: WARNING: Flex version $FlexVERSION found. + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Flex version $FlexVERSION found. Version 2.5.31 or greater is required. You can generally ignore this warning unless you need to regenerate psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c, use --with-flex to specify the @@ -3587,7 +3434,7 @@ $as_echo "$as_me: WARNING: Flex version $FlexVERSION found. fi else - { $as_echo "$as_me:$LINENO: WARNING: flex $LEX not found + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: flex $LEX not found You can generally ignore this warning unless you need to regenerate psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c, use --with-flex to specify the location of flex. @@ -3631,13 +3478,13 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -3645,8 +3492,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -3668,12 +3515,23 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -3723,14 +3581,15 @@ DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -3738,13 +3597,14 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -3754,17 +3614,18 @@ cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -3772,23 +3633,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -3796,7 +3649,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -3807,7 +3666,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -3830,13 +3689,6 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -3846,15 +3698,16 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -3866,12 +3719,16 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -3883,7 +3740,89 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -3897,8 +3836,12 @@ else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -3918,76 +3861,25 @@ $as_echo X/"$0" | } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -4002,49 +3894,85 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -4054,13 +3982,19 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4087,13 +4021,15 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -4104,16 +4040,17 @@ Usage: $0 [OPTION]... [FILE]... Configuration files: $config_files -Report bugs to <bug-autoconf@gnu.org>." +Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -4129,11 +4066,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -4147,14 +4089,17 @@ do ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -4163,11 +4108,10 @@ do ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -4184,7 +4128,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -4223,9 +4167,7 @@ do "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/mod_python") CONFIG_FILES="$CONFIG_FILES scripts/mod_python" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -4246,26 +4188,24 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -4273,7 +4213,13 @@ $debug || if test -n "$CONFIG_FILES"; then -ac_cr=' ' +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' @@ -4281,7 +4227,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -4290,24 +4236,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -4315,7 +4255,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -4329,7 +4269,7 @@ s/'"$ac_delim"'$// t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -4343,7 +4283,7 @@ s/.\{148\}// t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -4363,7 +4303,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -4395,23 +4335,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -4429,9 +4375,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -4450,7 +4394,7 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -4459,12 +4403,10 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -4475,7 +4417,7 @@ $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -4487,10 +4429,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -4518,47 +4458,7 @@ $as_echo X"$ac_file" | q } s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in @@ -4610,7 +4510,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= - ac_sed_dataroot=' /datarootdir/ { p @@ -4620,12 +4519,11 @@ ac_sed_dataroot=' /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' +/@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -4635,7 +4533,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -4662,27 +4560,24 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -4697,15 +4592,12 @@ $as_echo "$as_me: error: could not create $ac_file" >&2;} done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -4726,10 +4618,10 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff --git a/configure.in b/configure.in index 286516549d1b941e008734608e81f8dc4ea39f83..8aa8fd3c52d92675c8ca74ae0023b8b9ef5a1512 100644 --- a/configure.in +++ b/configure.in @@ -171,9 +171,7 @@ PyVERSION=`$PYTHON_BIN -c ['import sys; print(sys.version[:3])'`] PyMAJVERSION=`$PYTHON_BIN -c ['import sys; print(sys.version[:1])'`] PyMINVERSION=`$PYTHON_BIN -c ['import sys; print(sys.version.split(".")[1])'`] AC_MSG_RESULT($PyVERSION) -if test -z "$PyMAJVERSION"; then - AC_MSG_ERROR([Unable to get Python version - is your Python working?]) -fi + # make sure Python version is >= 2.6 for 2 and >= 3.3 for 3 if test "$PyMAJVERSION" -lt "2"; then AC_MSG_ERROR([This version of mod_python only works with Python major version 2 or higher. The one you have seems to be $PyVERSION.]) @@ -217,12 +215,21 @@ if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then standard_lib=1) +"/config")'` LDFLAGS="${LDFLAGS1} ${LDFLAGS2}" - if test "$PyMAJVERSION" -eq "3"; then - PyLDVERSION=`$PYTHON_BIN -c ['from distutils import sysconfig; print(sysconfig.get_config_var("LDVERSION"))'`] - LDLIBS1="-lpython${PyLDVERSION}" - else - LDLIBS1="-lpython${PyVERSION}" - fi + PYTHON_CODE=$(cat <<END +import distutils.sysconfig +lookingFor = "-lpython" +ret = str(distutils.sysconfig.get_config_var("BLDLIBRARY")) +if lookingFor not in ret: + cfg = distutils.sysconfig.get_config_vars() + for key in cfg: + if isinstance(cfg@<:@key@:>@, str) and lookingFor in cfg@<:@key@:>@: + ret = cfg@<:@key@:>@ + break +print(ret@<:@ret.find(lookingFor) if ret.find(lookingFor) != -1 else 0:@:>@) +END +) + + LDLIBS1=`${PYTHON_BIN} -c "$PYTHON_CODE"` LDLIBS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \ print(sysconfig.get_config_var("LIBS"))'` @@ -326,9 +333,9 @@ if test "$LEX" && test -x "$LEX"; then AC_MSG_CHECKING(flex version) FlexVERSION=`$LEX --version | sed 's/version//g' | awk '/flex/ {print $2}'` - Flex_MAJOR=`echo $FlexVERSION| awk -F . '{print $1}'` - Flex_MINOR=`echo $FlexVERSION| awk -F . '{print $2}'` - Flex_PATCH=`echo $FlexVERSION| awk -F . '{print $3}'` + Flex_MAJOR=`echo $FlexVERSION| awk -F. '{print $1}'` + Flex_MINOR=`echo $FlexVERSION| awk -F. '{print $2}'` + Flex_PATCH=`echo $FlexVERSION| awk -F. '{print $3}'` if test "$Flex_MAJOR" -eq "2" && test "$Flex_MINOR" -eq "5" && test "$Flex_PATCH" -ge "31"; then AC_MSG_RESULT([$FlexVERSION. Good]) diff --git a/dist/version.sh b/dist/version.sh index 1060b4fc412df6fdec01dc3e9eb35d603b386464..e50000d26eb1d8772d85f905ed81b8e4fbece6b3 100755 --- a/dist/version.sh +++ b/dist/version.sh @@ -5,6 +5,17 @@ MPV_PATH="`dirname $0`/../src/include/mp_version.h" MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH` MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH` PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH` -GIT=`git describe --always` -echo $MAJ.$MIN.$PCH-$GIT +# if git exists in path +if type git >/dev/null 2>&1; then + # and we are in a checkout + if git rev-parse 2>/dev/null; then + # but not on a tag (which means this is a release) + if test -z "`git log 'HEAD^!' --format=%d 2>/dev/null | grep 'tag: '`"; then + # append git revision hash to version + GIT="-`git describe --always`" + fi + fi +fi + +echo $MAJ.$MIN.$PCH$GIT diff --git a/doc-html/.buildinfo b/doc-html/.buildinfo deleted file mode 100644 index 1d391221022318118b93bce1a08b3d124817a94a..0000000000000000000000000000000000000000 --- a/doc-html/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: e64c10f7fbe0674c543acfba636b2bb2 -tags: fbb0d17656682115ca4d033fb2f83ba1 diff --git a/doc-html/_sources/about.txt b/doc-html/_sources/about.txt deleted file mode 100644 index e55956937af124fd98f30aa43aa36cbac80d600f..0000000000000000000000000000000000000000 --- a/doc-html/_sources/about.txt +++ /dev/null @@ -1,12 +0,0 @@ -===================== -About these documents -===================== - - -These documents are generated from `reStructuredText`_ sources by `Sphinx`_, a -document processor specifically written for the Python documentation. - -.. _reStructuredText: http://docutils.sf.net/rst.html -.. _Sphinx: http://sphinx.pocoo.org/ - - diff --git a/doc-html/_sources/changes.txt b/doc-html/_sources/changes.txt deleted file mode 100644 index aa4dfdd0fd26990f6c7a4b1258040c73a114e21f..0000000000000000000000000000000000000000 --- a/doc-html/_sources/changes.txt +++ /dev/null @@ -1,287 +0,0 @@ - -.. _changes: - -******* -Changes -******* - -.. _changes_from_3_4_1: - -Changes from version 3.4.1 -========================== - -New Features ------------- - -* Support for Python 3.3 - -Improvements ------------- - -* Simpler, faster and up-to-date with latest Python code for creating/maintaining interpreter and thread state. -* A much faster WSGI implementation (start_response now implemented in C) - -.. _changes_from_3_3_1: - -Changes from version 3.3.1 -========================== - -New Features ------------- - -* Create the mod_python command-line tool to report version, manage Apache configuration and instances. -* Make httpdconf directives render themselves as Python, add the only_if conditional and comments. -* Expose and document httpdconf, make mod_python importable outside of Apache. -* Provide a WSGI handler. -* Change the Copyright to reflect the new status. -* Add support for Apache HTTP Server 2.4. -* Add support for Python 2.7. - -Improvements ------------- - -* Improve WSGI and Python path documentation. -* Change WSGI handler to use Location path as SCRIPT_NAME. -* Add is_location to hlist object, skip the map_to_storage for Location-wrapped Python*Handlers. -* Some optimizations to Python code to make it run faster. -* Add Mutex to Apache 2.4 tests. -* Provide and internal add_cgi_vars() implementation which does not use sub-requests. -* Many documentation clarifications and improvements. -* Add a test to ensure that req.write() and req.flush() do not leak memory (2.4 only). -* Many new tests and test framework improvements. -* Added a curl hint to the tests for easier stagin/debugging. -* Get rid of the ancient memberlist and PyMember_Get/Set calls. -* Add support for the c.remote_ip/addr to c.client_ip/addr change in 2.4. Add req.useragent_addr (also new in 2.4). -* Always check C version against Py version and warn. -* Remove APLOG_NOERRNO references. -* A more unified and cleaned up method of keeping version information. -* Convert documentation to the new reStructuredText format. -* Revert to using the old importer from 3.2. -* Replace README with README.md -* (`MODPYTHON-238 <http://issues.apache.org/jira/browse/MODPYTHON-238>`_) Make req.chunked and req.connection.keepalive writable. Being able to set these allows chunking to be turned off when HTTP/1.1 is used but no content length supplied in response. -* (`MODPYTHON-226 <http://issues.apache.org/jira/browse/MODPYTHON-226>`_) Make req.status_line writable. - -Bug Fixes ---------- - -* Make PythonCleanupHandler run again. -* Use PCapsule API instead of PyCObject for Python 2.7+. -* Fix SCRIPT_NAME and PATH_INFO inconsistencies so that the WSGI handler behaves correctly. -* Remove with-python-src configure option as it is no longer used to build the docs. -* (`MODPYTHON-243 <http://issues.apache.org/jira/browse/MODPYTHON-243>`_) Fixed format string error. -* (`MODPYTHON-250 <http://issues.apache.org/jira/browse/MODPYTHON-250>`_) Fixed MacOS X (10.5) Leopard 64 bit architecture problems. -* (`MODPYTHON-249 <http://issues.apache.org/jira/browse/MODPYTHON-249>`_) Fixed incorrect use of APR bucket brigades shown up by APR 1.3.2. -* (`MODPYTHON-245 <http://issues.apache.org/jira/browse/MODPYTHON-245>`_) Fix prototype of optional exported function mp_release_interpreter(). -* (`MODPYTHON-220 <http://issues.apache.org/jira/browse/MODPYTHON-220>`_) Fix 'import' from same directory as PSP file. - -.. _changes_from_3_2_10: - -Changes from version 3.2.10 -=========================== - -New Features ------------- - -* (`MODPYTHON-103 <http://issues.apache.org/jira/browse/MODPYTHON-103>`_) New req.add_output_filter(), req.add_input_filter(), req.register_output_fiter(), req.register_input_filter() methods. These allows the dynamic registration of filters and the attaching of filters to the current request. -* (`MODPYTHON-104 <http://issues.apache.org/jira/browse/MODPYTHON-104>`_) Support added for using Python in content being passed through "INCLUDES" output filter, or as more commonly referred to server side include (SSI) mechanism. -* (`MODPYTHON-108 <http://issues.apache.org/jira/browse/MODPYTHON-108>`_) Added support to cookies for httponly attribute, an extension originally created by Microsoft, but now getting more widespread use in the battle against cross site-scripting attacks. -* (`MODPYTHON-118 <http://issues.apache.org/jira/browse/MODPYTHON-118>`_) Now possible using the PythonImport directive to specify the name of a function contained in the module to be called once the designated module has been imported. -* (`MODPYTHON-124 <http://issues.apache.org/jira/browse/MODPYTHON-124>`_) New req.auth_name() and req.auth_type() methods. These return the values associated with the AuthName and AuthType directives respectively. The req.ap_auth_type has now also been made writable so that it can be set by an authentication handler. -* (`MODPYTHON-130 <http://issues.apache.org/jira/browse/MODPYTHON-130>`_) Added req.set_etag(), req.set_last_modified() and req.update_mtime() functions as wrappers for similar functions provided by Apache C API. These are required to effectively use the req.meets_condition() function. The documentation for req.meets_condition() has also been updated as what it previously described probably wouldn't actually work. -* (`MODPYTHON-132 <http://issues.apache.org/jira/browse/MODPYTHON-132>`_) New req.construct_url() method. Used to construct a fully qualified URI string incorporating correct scheme, server and port. -* (`MODPYTHON-144 <http://issues.apache.org/jira/browse/MODPYTHON-144>`_) The "apache.interpreter" and "apache.main_server" attributes have been made publically available. These were previously private and not part of the public API. -* (`MODPYTHON-149 <http://issues.apache.org/jira/browse/MODPYTHON-149>`_) Added support for session objects that span domains. -* (`MODPYTHON-153 <http://issues.apache.org/jira/browse/MODPYTHON-153>`_) Added req.discard_request_body() function as wrapper for similar function provided by Apache C API. The function tests for and reads any message body in the request, simply discarding whatever it receives. -* (`MODPYTHON-164 <http://issues.apache.org/jira/browse/MODPYTHON-164>`_) The req.add_handler(), req.register_input_filter() and req.register_output_filter() methods can now take a direct reference to a callable object as well a string which refers to a module or module::function combination by name. -* (`MODPYTHON-165 <http://issues.apache.org/jira/browse/MODPYTHON-165>`_) Exported functions from mod_python module to be used in other third party modules for Apache. The purpose of these functions is to allow those other modules to access the mechanics of how mod_python creates interpreters, thereby allowing other modules to also embed Python and for there not to be a conflict with mod_python. -* (`MODPYTHON-170 <http://issues.apache.org/jira/browse/MODPYTHON-170>`_) Added req._request_rec, server._server_rec and conn._conn_rec semi private members for getting accessing to underlying Apache struct as a Python CObject. These can be used for use in implementing SWIG bindings for lower level APIs of Apache. These members should be regarded as experimental and there are no guarantees that they will remain present in this specific form in the future. -* (`MODPYTHON-193 <http://issues.apache.org/jira/browse/MODPYTHON-193>`_) Added new attribute available as req.hlist.location. For a handler executed directly as the result of a handler directive within a Location directive, this will be set to the value of the Location directive. If LocationMatch, or wildcards or regular expressions are used with Location, the value will be the matched value in the URL and not the pattern. - -Improvements ------------- - -* (`MODPYTHON-27 <http://issues.apache.org/jira/browse/MODPYTHON-27>`_) When using mod_python.publisher, the __auth__() and __access__() functions and the __auth_realm__ string can now be nested within a class method as a well a normal function. -* (`MODPYTHON-90 <http://issues.apache.org/jira/browse/MODPYTHON-90>`_) The PythonEnablePdb configuration option will now be ignored if Apache hasn't been started up in single process mode. -* (`MODPYTHON-91 <http://issues.apache.org/jira/browse/MODPYTHON-91>`_) If running Apache in single process mode with PDB enabled and the "quit" command is used to exit that debug session, an exception indicating that the PDB session has been aborted is raised rather than None being returned with a subsequent error complaining about the handler returning an invalid value. -* (`MODPYTHON-93 <http://issues.apache.org/jira/browse/MODPYTHON-93>`_) Improved util.FieldStorage efficiency and made the interface more dictionary like. -* (`MODPYTHON-101 <http://issues.apache.org/jira/browse/MODPYTHON-101>`_) Force an exception when handler evaluates to something other than None but is otherwise not callable. Previously an exception would not be generated if the handler evaluated to False. -* (`MODPYTHON-107 <http://issues.apache.org/jira/browse/MODPYTHON-107>`_) Neither mod_python.publisher nor mod_python.psp explicitly flush output after writing the content of the response back to the request object. By not flushing output it is now possible to use the "CONTENT_LENGTH" output filter to add a "Content-Length" header. -* (`MODPYTHON-111 <http://issues.apache.org/jira/browse/MODPYTHON-111>`_) Note made in session documentation that a save is required to avoid session timeouts. -* (`MODPYTHON-125 <http://issues.apache.org/jira/browse/MODPYTHON-125>`_) The req.handler attribute is now writable. This allows a handler executing in a phase prior to the response phase to specify which Apache module will be responsible for generating the content. -* (`MODPYTHON-128 <http://issues.apache.org/jira/browse/MODPYTHON-128>`_) Made the req.canonical_filename attribute writable. Changed the req.finfo attribute from being a tuple to an actual object. For backwards compatibility the attributes of the object can still be accessed as if they were a tuple. New code however should access the attributes as member data. The req.finfo attribute is also now writable and can be assigned to using the result of calling the new function apache.stat(). This function is a wrapper for apr_stat(). -* (`MODPYTHON-129 <http://issues.apache.org/jira/browse/MODPYTHON-129>`_) When specifying multiple handlers for a phase, the status returned by each handler is now treated the same as how Apache would treat the status if the handler was registered using the low level C API. What this means is that whereas stacked handlers of any phase would in turn previously be executed as long as they returned apache.OK, this is no longer the case and what happens is dependent on the phase. Specifically, a handler returning apache.DECLINED no longer causes the execution of subsequent handlers for the phase to be skipped. Instead, it will move to the next of the stacked handlers. In the case of PythonTransHandler, PythonAuthenHandler, PythonAuthzHandler and PythonTypeHandler, as soon as apache.OK is returned, subsequent handlers for the phase will be skipped, as the result indicates that any processing pertinent to that phase has been completed. For other phases, stacked handlers will continue to be executed if apache.OK is returned as well as when apache.DECLINED is returned. This new interpretation of the status returned also applies to stacked content handlers listed against the PythonHandler directive even though Apache notionally only ever calls at most one content handler. Where all stacked content handlers in that phase run, the status returned from the last handler becomes the overall status from the content phase. -* (`MODPYTHON-141 <http://issues.apache.org/jira/browse/MODPYTHON-141>`_) The req.proxyreq and req.uri attributes are now writable. This allows a handler to setup these values and trigger proxying of the current request to a remote server. -* (`MODPYTHON-142 <http://issues.apache.org/jira/browse/MODPYTHON-142>`_) The req.no_cache and req.no_local_copy attributes are now writable. -* (`MODPYTHON-143 <http://issues.apache.org/jira/browse/MODPYTHON-143>`_) Completely reimplemented the module importer. This is now used whenever modules are imported corresponding to any of the Python*Handler, Python*Filter and PythonImport directives. The module importer is still able to be used directly using the apache.import_module() function. The new module importer no longer supports automatic reloading of packages/modules that appear on the standard Python module search path as defined by the PythonPath directive or within an application by direct changes to sys.path. Automatic module reloading is however still performed on file based modules (not packages) which are located within the document tree where handlers are located. Locations within the document tree are however no longer added to the standard Python module search path automatically as they are maintained within a distinct importer search path. The PythonPath directive MUST not be used to point at directories within the document tree. To have additional directories be searched by the module importer, they should be listed in the mod_python.importer.path option using the PythonOption directive. This is a path similar to how PythonPath argument is supplied, but MUST not reference sys.path nor contain any directories also listed in the standard Python module search path. If an application does not appear to work under the module importer, the old module importer can be reenabled by setting the mod_python.legacy.importer option using the PythonOption directive to the value '*'. This option must be set in the global Apache configuration. -* (`MODPYTHON-152 <http://issues.apache.org/jira/browse/MODPYTHON-152>`_) When in a sub request, when a request is the result of an internal redirect, or when when returning from such a request, the req.main, req.prev and req.next members now correctly return a reference to the original Python request object wrapper first created for the specific request_rec instance rather than creating a new distinct Python request object. This means that any data added explicitly to a request object can be passed between such requests. -* (`MODPYTHON-178 <http://issues.apache.org/jira/browse/MODPYTHON-178>`_) When using mod_python.psp, if the PSP file which is the target of the request doesn't actually exist, an apache.HTTP_NOT_FOUND server error is now returned to the client rather than raising a ValueError exception which results in a 500 internal server error. Note that if using SetHandler and the request is against the directory and no DirectoryIndex directive is specified which lists a valid PSP index file, then the same apache.HTTP_NOT_FOUND server error is returned to the client. -* (`MODPYTHON-196 <http://issues.apache.org/jira/browse/MODPYTHON-196>`_) For completeness, added req.server.log_error() and req.connection.log_error(). The latter wraps ap_log_cerror() (when available), allowing client information to be logged along with message from a connection handler. -* (`MODPYTHON-206 <http://issues.apache.org/jira/browse/MODPYTHON-206>`_) The attribute req.used_path_info is now modifiable and can be set from within handlers. This is equivalent to having used the AcceptPathInfo directive. -* (`MODPYTHON-207 <http://issues.apache.org/jira/browse/MODPYTHON-207>`_) The attribute req.args is now modifiable and can be set from within handlers. - -Bug Fixes ---------- - -* (`MODPYTHON-38 <http://issues.apache.org/jira/browse/MODPYTHON-38>`_) Fixed issue when using PSP pages in conjunction with publisher handler or where a PSP error page was being triggered, that form parameters coming from content of a POST request weren't available or only available using a workaround. Specifically, the PSP page will now use any FieldStorage object instance cached as req.form left there by preceding code. -* (`MODPYTHON-43 <http://issues.apache.org/jira/browse/MODPYTHON-43>`_) Nested __auth__() functions in mod_python.publisher now execute in context of globals from the file the function is in and not that of mod_python.publisher itself. -* (`MODPYTHON-47 <http://issues.apache.org/jira/browse/MODPYTHON-47>`_) Fixed mod_python.publisher so it will not return a HTTP Bad Request response when mod_auth is being used to provide Digest authentication. -* (`MODPYTHON-63 <http://issues.apache.org/jira/browse/MODPYTHON-63>`_) When handler directives are used within Directory or DirectoryMatch directives where wildcards or regular expressions are used, the handler directory will be set to the shortest directory matched by the directory pattern. Handler directives can now also be used within Files and FilesMatch directives and the handler directory will correctly resolve to the directory corresponding to the enclosing Directory or DirectoryMatch directive, or the directory the .htaccess file is contained in. -* (`MODPYTHON-76 <http://issues.apache.org/jira/browse/MODPYTHON-76>`_) The FilterDispatch callback should not flush the filter if it has already been closed. -* (`MODPYTHON-84 <http://issues.apache.org/jira/browse/MODPYTHON-84>`_) The original change to fix the symlink issue for req.sendfile() was causing problems on Win32, plus code needed to be changed to work with APR 1.2.7. -* (`MODPYTHON-100 <http://issues.apache.org/jira/browse/MODPYTHON-100>`_) When using stacked handlers and a SERVER_RETURN exception was used to return an OK status for that handler, any following handlers weren't being run if appropriate for the phase. -* (`MODPYTHON-109 <http://issues.apache.org/jira/browse/MODPYTHON-109>`_) The Py_Finalize() function was being called on child process shutdown. This was being done though from within the context of a signal handler, which is generally unsafe and would cause the process to lock up. This function is no longer called on child process shutdown. -* (`MODPYTHON-112 <http://issues.apache.org/jira/browse/MODPYTHON-112>`_) The req.phase attribute is no longer overwritten by an input or output filter. The filter.is_input member should be used to determine if a filter is an input or output filter. -* (`MODPYTHON-113 <http://issues.apache.org/jira/browse/MODPYTHON-113>`_) The PythonImport directive now uses the apache.import_module() function to import modules to avoid reloading problems when same module is imported from a handler. -* (`MODPYTHON-114 <http://issues.apache.org/jira/browse/MODPYTHON-114>`_) Fixed race conditions on setting sys.path when the PythonPath directive is being used as well as problems with infinite extension of path. -* (`MODPYTHON-120 <http://issues.apache.org/jira/browse/MODPYTHON-120>`_) (`MODPYTHON-121 <http://issues.apache.org/jira/browse/MODPYTHON-121>`_) Fixes to test suite so it will work on virtual hosting environments where localhost doesn't resolve to 127.0.0.1 but the actual IP address of the host. -* (`MODPYTHON-126 <http://issues.apache.org/jira/browse/MODPYTHON-126>`_) When Python*Handler or Python*Filter directive is used inside of a Files directive container, the handler/filter directory value will now correctly resolve to the directory corresponding to any parent Directory directive or the location of the .htaccess file the Files directive is contained in. -* (`MODPYTHON-133 <http://issues.apache.org/jira/browse/MODPYTHON-133>`_) The table object returned by req.server.get_config() was not being populated correctly to be the state of directives set at global scope for the server. -* (`MODPYTHON-134 <http://issues.apache.org/jira/browse/MODPYTHON-134>`_) Setting PythonDebug to Off, wasn't overriding On setting in parent scope. -* (`MODPYTHON-140 <http://issues.apache.org/jira/browse/MODPYTHON-140>`_) The util.redirect() function should be returning server status of apache.DONE and not apache.OK otherwise it will not give desired result if used in non content handler phase or where there are stacked content handlers. -* (`MODPYTHON-147 <http://issues.apache.org/jira/browse/MODPYTHON-147>`_) Stopped directories being added to sys.path multiple times when PythonImport and PythonPath directive used. -* (`MODPYTHON-148 <http://issues.apache.org/jira/browse/MODPYTHON-148>`_) Added missing Apache contants apache.PROXYREQ_RESPONSE and apache.HTTP_UPGRADE_REQUIRED. Also added new constants for Apache magic mime types and values for interpreting the req.connection.keepalive and req.read_body members. -* (`MODPYTHON-150 <http://issues.apache.org/jira/browse/MODPYTHON-150>`_) In a multithread MPM, the apache.init() function could be called more than once for a specific interpreter instance whereas it should only be called once. -* (`MODPYTHON-151 <http://issues.apache.org/jira/browse/MODPYTHON-151>`_) Debug error page returned to client when an exception in a handler occurred wasn't escaping special HTML characters in the traceback or the details of the exception. -* (`MODPYTHON-157 <http://issues.apache.org/jira/browse/MODPYTHON-157>`_) Wrong interpreter name used for fixup handler phase and earlier, when PythonInterpPerDirectory was enabled and request was against a directory but client didn't provide the trailing slash. -* (`MODPYTHON-159 <http://issues.apache.org/jira/browse/MODPYTHON-159>`_) Fix FieldStorage class so that it can handle multiline headers. -* (`MODPYTHON-160 <http://issues.apache.org/jira/browse/MODPYTHON-160>`_) Using PythonInterpPerDirective when setting content handler to run dynamically with req.add_handler() would cause Apache to crash. -* (`MODPYTHON-161 <http://issues.apache.org/jira/browse/MODPYTHON-161>`_) Directory argument supplied to req.add_handler() is canonicalized and a trailing slash added automatically. This is needed to ensure that the directory is always in POSIX path style as used by Apache and that convention where directories associated with directives always have trailing slash is adhered to. If this is not done, a different interpreter can be chosen to that expected when the PythonInterpPerDirective is used. -* (`MODPYTHON-166 <http://issues.apache.org/jira/browse/MODPYTHON-166>`_) PythonHandlerModule was not setting up registration of the PythonFixupHandler or PythonAuthenHandler. For the latter this meant that using Require directive with PythonHandlerModule would cause a 500 error and complaint in error log about "No groups file". -* (`MODPYTHON-167 <http://issues.apache.org/jira/browse/MODPYTHON-167>`_) When PythonDebug was On and and exception occurred, the response to the client had a status of 200 when it really should have been a 500 error status indicating that an internal error occurred. A 500 error status was correctly being returned when PythonDebug was Off. -* (`MODPYTHON-168 <http://issues.apache.org/jira/browse/MODPYTHON-168>`_) Fixed psp_parser error when CR is used as a line terminator in psp code. This may occur with some older editors such as GoLive on Mac OS X. -* (`MODPYTHON-175 <http://issues.apache.org/jira/browse/MODPYTHON-175>`_) Fixed problem whereby a main PSP page and an error page triggered from that page both accessing the session object would cause a deadlock. -* (`MODPYTHON-176 <http://issues.apache.org/jira/browse/MODPYTHON-176>`_) Fixed issue whereby PSP code would unlock session object which it had inherited from the caller meaning caller could no longer use it safely. PSP code will now only unlock session if it created it in the first place. -* (`MODPYTHON-179 <http://issues.apache.org/jira/browse/MODPYTHON-179>`_) Fixed the behaviour of req.readlines() when a size hint was provided. Previously, it would always return a single line when a size hint was provided. -* (`MODPYTHON-180 <http://issues.apache.org/jira/browse/MODPYTHON-180>`_) Publisher would wrongly output a warning about nothing to publish if req.write() or req.sendfile() used and data not flushed, and then published function returned None. -* (`MODPYTHON-181 <http://issues.apache.org/jira/browse/MODPYTHON-181>`_) Fixed memory leak when mod_python handlers are defined for more than one phase at the same time. -* (`MODPYTHON-182 <http://issues.apache.org/jira/browse/MODPYTHON-182>`_) Fixed memory leak in req.readline(). -* (`MODPYTHON-184 <http://issues.apache.org/jira/browse/MODPYTHON-184>`_) Fix memory leak in apache.make_table(). This was used by util.FieldStorage class so affected all code using forms. -* (`MODPYTHON-185 <http://issues.apache.org/jira/browse/MODPYTHON-185>`_) Fixed segfault in psp.parsestring(src_string) when src_string is empty. -* (`MODPYTHON-187 <http://issues.apache.org/jira/browse/MODPYTHON-187>`_) Table objects could crash in various ways when the value of an item was NULL. This could occur for SCRIPT_FILENAME when the req.subprocess_env table was accessed in the post read request handler phase. -* (`MODPYTHON-189 <http://issues.apache.org/jira/browse/MODPYTHON-189>`_) Fixed representation returned by calling repr() on a table object. -* (`MODPYTHON-191 <http://issues.apache.org/jira/browse/MODPYTHON-191>`_) Session class will no longer accept a normal cookie if a signed cookie was expected. -* (`MODPYTHON-194 <http://issues.apache.org/jira/browse/MODPYTHON-194>`_) Fixed potential memory leak due to not clearing the state of thread state objects before deleting them. -* (`MODPYTHON-195 <http://issues.apache.org/jira/browse/MODPYTHON-195>`_) Fix potential Win32 resource leaks in parent Apache process when process restarts occur. -* (`MODPYTHON-198 <http://issues.apache.org/jira/browse/MODPYTHON-198>`_) Python 2.5 broke nested __auth__/__access__/__auth_realm__ in mod_python.publisher. -* (`MODPYTHON-200 <http://issues.apache.org/jira/browse/MODPYTHON-200>`_) Fixed problem whereby signed and marshalled cookies could not be used at the same time. When expecting marshalled cookie, any signed, but not marshalled cookies will be returned as normal cookies. - - -.. _changes_from_3_2_8: - -Changes from version 3.2.8 -========================== - -New Features ------------- - -* (`MODPYTHON-78 <http://issues.apache.org/jira/browse/MODPYTHON-78>`_) Added support for Apache 2.2. -* (`MODPYTHON-94 <http://issues.apache.org/jira/browse/MODPYTHON-94>`_) New req.is_https() and req.ssl_var_lookup() methods. These communicate direct with the Apache mod_ssl module, allowing it to be determined if the connection is using SSL/TLS and what the values of internal ssl variables are. -* (`MODPYTHON-131 <http://issues.apache.org/jira/browse/MODPYTHON-131>`_) The directory used for mutex locks can now be specified at at compile time using ./configure --with-mutex-dir value or at run time with PythonOption mod_python.mutex_directory value. -* (`MODPYTHON-137 <http://issues.apache.org/jira/browse/MODPYTHON-137>`_) New req.server.get_options() method. This returns the subset of Python options set at global scope within the Apache configuration. That is, outside of the context of any VirtualHost, Location, Directory or Files directives. -* (`MODPYTHON-145 <http://issues.apache.org/jira/browse/MODPYTHON-145>`_) The number of mutex locks can now be specified at run time with PythonOption mod_python.mutex_locks value. -* (`MODPYTHON-172 <http://issues.apache.org/jira/browse/MODPYTHON-172>`_) Fixed three memory leaks that were found in _apachemodule.parse_qsl, req.readlines and util.cfgtree_walk. - -Improvements ------------- - -* (`MODPYTHON-77 <http://issues.apache.org/jira/browse/MODPYTHON-77>`_) Third party C modules that use the simplified API for the Global Interpreter Lock (GIL), as described in PEP 311, can now be used. The only requirement is that such modules can only be used in the context of the "main_interpreter". -* (`MODPYTHON-119 <http://issues.apache.org/jira/browse/MODPYTHON-119>`_) DbmSession unit test no longer uses the default directory for the dbm file, so the test will not interfer with the user's current apache instance. -* (`MODPYTHON-158 <http://issues.apache.org/jira/browse/MODPYTHON-158>`_) Added additional debugging and logging output for where mod_python cannot initialise itself properly due to Python or mod_python version mismatches or missing Python module code files. - -Bug Fixes ---------- - -* (`MODPYTHON-84 <http://issues.apache.org/jira/browse/MODPYTHON-84>`_) Fixed request.sendfile() bug for symlinked files on Win32. -* (`MODPYTHON-122 <http://issues.apache.org/jira/browse/MODPYTHON-122>`_) Fixed configure problem when using bash 3.1.x. -* (`MODPYTHON-173 <http://issues.apache.org/jira/browse/MODPYTHON-173>`_) Fixed DbmSession to create db file with mode 0640. - - -.. _changes_from_3_2_7: - -Changes from version 3.2.7 -========================== - -Security Fix ------------- - -* (`MODPYTHON-135 <http://issues.apache.org/jira/browse/MODPYTHON-135>`_) Fixed possible directory traversal attack in FileSession. The session id is now checked to ensure it only contains valid characters. This check is performed for all sessions derived from the BaseSession class. - -.. _changes_from_3_1_4: - -Changes from version 3.1.4 -========================== - -New Features ------------- - -* New apache.register_cleanup() method. -* New apache.exists_config_define() method. -* New file-based session manager class. -* Session cookie name can be specified. -* The maximum number of mutexes mod_python uses for session locking can now be specifed at compile time using configure --with-max-locks. -* New a version attribute in mod_python module. -* New test handler testhandler.py has been added. - -Improvements ------------- - -* Autoreload of a module using apache.import_module() now works if modification time for the module is different from the file. Previously, the module was only reloaded if the the modification time of the file was more recent. This allows for a more graceful reload if a file with an older modification time needs to be restored from backup. -* Fixed the publisher traversal security issue -* Objects hierarchy a la CherryPy can now be published. -* mod_python.c now logs reason for a 500 error -* Calls to PyErr_Print in mod_python.c are now followed by fflush() -* Using an empty value with PythonOption will unset a PythonOption key. -* req.path_info is now a read/write member. -* Improvements to FieldStorage allow uploading of large files. Uploaded files are now streamed to disk, not to memory. -* Path to flex is now discovered at configuration time or can be specifed using configure --with-flex=/path/to/flex. -* sys.argv is now initialized to ["mod_python"] so that modules like numarray and pychart can work properly. - -Bug Fixes ---------- - -* Fixed memory leak which resulted from circular references starting from the request object. -* Fixed memory leak resulting from multiple PythonOption directives. -* Fixed Multiple/redundant interpreter creation problem. -* Cookie attributes with attribute names prefixed with $ are now ignored. See Section 4.7 for more information. -* Bug in setting up of config_dir from Handler directives fixed. -* mod_python.publisher will now support modules with the same name but in different directories -* Fixed continual reloading of modules problem -* Fixed big marshalled cookies error. -* Fixed mod_python.publisher extension handling -* mod_python.publisher default index file traversal -* mod_python.publisher loading wrong module and giving no warning/error -* apply_fs_data() now works with "new style" objects -* File descriptor fd closed after ap_send_fd() in req_sendfile() -* Bug in mem_cleanup in MemorySession fixed. -* Fixed bug in _apache._global_lock() which could cause a segfault if the lock index parameter is greater number of mutexes created at mod_python startup. -* Fixed bug where local_ip and local_host in connection object were returning remote_ip and remote_host instead -* Fixed install_dso Makefile rule so it only installs the dso, not the python files -* Potential deadlock in psp cache handling fixed -* Fixed bug where sessions are used outside <Directory> directive. -* Fixed compile problem on IRIX. ln -s requires both TARGET and LINK_NAME on IRIX. ie. ln -s TARGET LINK_NAME -* Fixed ./configure problem on SuSE Linux 9.2 (x86-64). Python libraries are in lib64/ for this platform. -* Fixed req.sendfile() problem where sendfile(filename) sends the incorrect number of bytes when filename is a symlink. -* Fixed problem where util.FieldStorage was not correctly checking the mime types of POSTed entities -* Fixed conn.local_addr and conn.remote_addr for a better IPv6 support. -* Fixed psp_parser.l to properly escape backslash-n, backslash-t and backslash-r character sequences. -* Fixed segfault bug when accessing some request object members (allowed_methods, allowed_xmethods, content_languages) and some server object members (names, wild_names). -* Fixed request.add_handler() segfault bug when adding a handler to an empty handler list. -* Fixed PythonAutoReload directive so that AutoReload can be turned off. -* Fixed connection object read() bug on FreeBSD. -* Fixed potential buffer corruption bug in connection object read(). - -.. _changes_from_2_x: - -Changes from version 2.x -======================== - -* Mod_python 3.0 no longer works with Apache 1.3, only Apache 2.x is supported. -* Mod_python no longer works with Python versions less than 2.2.1 -* Mod_python now supports Apache filters. -* Mod_python now supports Apache connection handlers. -* Request object supports internal_redirect(). -* Connection object has read(), readline() and write(). -* Server object has get_config(). -* Httpdapi handler has been deprecated. -* Zpublisher handler has been deprecated. -* Username is now in req.user instead of req.connection.user diff --git a/doc-html/_sources/commandline.txt b/doc-html/_sources/commandline.txt deleted file mode 100644 index e2a31ca0c54c26089fa19ffb1195f8c5d8862824..0000000000000000000000000000000000000000 --- a/doc-html/_sources/commandline.txt +++ /dev/null @@ -1,134 +0,0 @@ -.. _cmd: - -****************************** -Command Line Tool - mod_python -****************************** - -.. _cmd-overview: - -Overview of mod_python command -============================== - -mod_python includes a command-line tool named ``mod_python``. The -``mod_python`` command exists to facilitate tasks related to -configuration and management of mod_python. - -The general syntax for the command is ``mod_python <subcommand> <arguments>`` -where ``<subcommand>`` is a separate tool with its own argument requirements. - -.. _cmd-subcommands: - -mod_python command line tool sub-commands -========================================= - -create ------- - -``create`` sub-command creates a simple Apache configuration and a -skeleton directory structure necessary for placement of configuration, -logs and content. It is meant to be executed only once per lifetime of -a project. - -The configuration generated by ``create`` consists of an -:mod:`httpdconf` based version (in Python) which can then be used to -generate an actual Apache configuration (by using the ``genconfig`` -subcommand or simply executing the config files itself). The idea is -that the Apache configuration is always generated and the Python -version is the one meant for editing/adjustments. - -The ``create`` subcommand will create the necessary files and -directories if they do not exist, but will not overwrite any existing -files or directories only producing a warning when a file or directory -already exists. It will abort if the Python version of the -configuration file already exists. - -``create`` requires a single argument: the distination directory, -Apache ``ServerRoot``. - -``create`` has the following command options: - -.. cmdoption:: --listen - - A string describing the port and optional IP address on which the - server is to listen for incoming requests in the form - ``[ip_address:]port`` The argument will be applied to the Apache - ``Listen`` directive as is and therefore must be syntactically - compatible with it. - -.. cmdoption:: --pythonpath - - A colon (``":"``) separate list of paths to be applied to the - :ref:`dir-other-pp` directive. - -.. cmdoption:: --pythonhandler - - The name of the Python handler to use. Applied to the - :ref:`dir-handlers-ph` directive. - -.. cmdoption:: --pythonoption - - An option to be specified in the configuration. Multiple options - are alowed. Applied to the :ref:`dir-other-po` directive. - -.. _cmd-sub-create-example: - -genconfig ---------- - -This sub-command exists to facilitate re-generation of an Apache -configuration from a Python-based one. All it does is run the script, -but its use is recommended because the mod_python command will execute -the correct version of Python under which mod_python was initially -compiled. Example:: - - mod_python genconfig /path/to/server_root/httpd_conf.py > /path/to/server_root/httpd.conf - -start ------ - -Starts an Apache instance. Requires a single argument, the path to -Apache configuration file. - -stop ----- - -Stops an Apache instance (using graceful-stop). Requires a single -argument, the path to Apache configuration file. - -restart -------- - -Stops an Apache instance (using graceful). Requires a single argument, -the path to Apache configuration file. - -version -------- - -This sub-command prints out version and location information about -this mod_python installation, the Apache HTTP Server and Python used -when building this mod_python instance. - -Example -------- - -To create an Apache instance with all the required directories for a -WSGI application which is located in ``/path/to/myapp`` and defined in -``/path/to/myapp/myapp/myapp/wsgi.py``, run the following:: - - mod_python create /path/to/new/server_root \ - --pythonpath=/path/to/my/app \ - --pythonhandler=mod_python.wsgi \ - --pythonoption="mod_python.wsgi.application myapp.wsgi::application" - -The above example will create a Python-based configuration in -``/path/to/new/server_root/conf/http_conf.py`` which is a simple -Pythong script. When executed, the output of the script becomes an -Apache configuration (``create`` will take care of generating the -first Apache config for you). - -You should be able to run this Apache instance by executing:: - - mod_python start /path/to/new/server_root/conf/httpd.conf - - - diff --git a/doc-html/_sources/contents.txt b/doc-html/_sources/contents.txt deleted file mode 100644 index 2265d7c94e3427b489128bc1bb23e6232c893020..0000000000000000000000000000000000000000 --- a/doc-html/_sources/contents.txt +++ /dev/null @@ -1,30 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%% - Mod_python Documentation -%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This document aims to be the only necessary and authoritative source -of information about mod_python, usable as a comprehensive reference, -a user guide and a tutorial all-in-one. - -.. seealso:: - - `Python Language Web Site <http://www.python.org/>`_ - for information on the Python language - - `Apache HTTP Server Project Web Site <http://httpd.apache.org/>`_ - for information on the Apache server - -.. toctree:: - - introduction.rst - installation.rst - tutorial.rst - pythonapi.rst - directives.rst - handlers.rst - commandline.rst - ssi.rst - changes.rst - license.rst - about.rst - copyright.rst diff --git a/doc-html/_sources/copyright.txt b/doc-html/_sources/copyright.txt deleted file mode 100644 index f770901c77f0bec1ac700fc9a1fd9ad0f9899c74..0000000000000000000000000000000000000000 --- a/doc-html/_sources/copyright.txt +++ /dev/null @@ -1,13 +0,0 @@ -********* -Copyright -********* - -Mod_python and this documentation is: - -Copyright © 2000, 2001, 2013 Gregory Trubetskoy - -Copyright © 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation - -------- - -See :ref:`history-and-license` for complete license and permissions information. diff --git a/doc-html/_sources/directives.txt b/doc-html/_sources/directives.txt deleted file mode 100644 index 87fe33061022c8ab460a55a138389d4c00b79f7c..0000000000000000000000000000000000000000 --- a/doc-html/_sources/directives.txt +++ /dev/null @@ -1,987 +0,0 @@ - -.. |br| raw:: html - - <br /> - -.. _directives: - -******************************* -Apache Configuration Directives -******************************* - -.. _dir-handlers: - -Request Handlers -================ - -.. _dir-handlers-syn: - -Python*Handler Directive Syntax -------------------------------- - -.. index:: - single: Python*Handler Syntax - - -All request handler directives have the following syntax: - -``Python*Handler handler [handler ...] [ | .ext [.ext ...] ]`` - -Where *handler* is a callable object that accepts a single argument - -request object, and *.ext* is an optional file extension. - -Multiple handlers can be specified on a single line, in which case -they will be called sequentially, from left to right. Same handler -directives can be specified multiple times as well, with the same -result - all handlers listed will be executed sequentially, from first -to last. - -If any handler in the sequence returns a value other than -``apache.OK`` or ``apache.DECLINED``, then execution of all subsequent -handlers for that phase is aborted. What happens when either -``apache.OK`` or ``apache.DECLINED`` is returned is dependent on which -phase is executing. - -Note that prior to mod_python 3.3, if any handler in the sequence, no -matter which phase was executing, returned a value other than -``apache.OK``, then execution of all subsequent handlers for that phase -was aborted. - -The list of handlers can optionally be followed by a ``|`` followed -by one or more file extensions. This would restrict the execution of -the handler to those file extensions only. This feature only works for -handlers executed after the trans phase. - -A *handler* has the following syntax: - -``module[::object]`` - -Where *module* can be a full module name (package dot notation is -accepted) or an actual path to a module code file. The module is loaded -using the mod_python module importer as implemented by the -``apache.import_module()`` function. Reference should be made to -the documentation of that function for further details of how module -importing is managed. - -The optional *object* is the name of an object inside the module. -Object can also contain dots, in which case it will be resolved from -left to right. During resolution, if mod_python encounters an object -of type ``<class>``, it will try instantiating it passing it a single -argument, a request object. - -If no object is specified, then it will default to the directive of -the handler, all lower case, with the word ``'python'`` -removed. E.g. the default object for PythonAuthenHandler would be -authenhandler. - -Example:: - - PythonAuthzHandler mypackage.mymodule::checkallowed - -For more information on handlers, see :ref:`pyapi-handler`. - -.. note:: The ``'::'`` was chosen for performance reasons. In order - for Python to use objects inside modules, the modules first need to - be imported. Having the separator as simply a ``'.'``, would - considerably complicate process of sequentially evaluating every - word to determine whether it is a package, module, class etc. Using - the (admittedly un-Python-like) ``'::'`` removes the time-consuming - work of figuring out where the module part ends and the object - inside of it begins, resulting in a modest performance gain. - -.. index:: - pair: phase; order - -The handlers in this document are listed in order in which phases are -processed by Apache. - -.. _dir-handlers-pp: - -Python*Handlers and Python path -------------------------------- - -.. index:: - pair: pythonpath, Python*Handler - -If a ``Python*Handler`` directive is specified in a *directory section* -(i.e. inside a ``<Directory></Directory>`` or -``<DirectoryMatch></DirectoryMatch>`` or in an ``.htaccess`` file), -then this directory is automatically prepended to the Python path -(``sys.path``) *unless* Python path is specified explicitely with the -``PythonPath`` directive. - -If a ``Python*Handler`` directive is specified in a *location section* -(i.e. inside ``<Location></Location>`` or -``<LocationMatch></LocationMatch>``), then no path modification is done -automatically and in most cases a ``PythonPath`` directive is required -to augment the path so that the handler module can be imported. - -Also for ``Python*Handlers`` inside a location section mod_python -disables the phase of the request that maps the URI to a file on the -filesystem (``ap_hook_map_to_storage``). This is because there is -usually no link between path specified in ``<Location>`` and the -filesystem, while attempting to map to a filesystem location results -in unnecessary and expensive filesystem calls. Note that an important -side-effect of this is that once a request URI has been matched to a -``<Location>`` containing a mod_python handler, all ``<Directory>`` -and ``<DirectoryMatch>`` directives and their contents are ignored for -this request. - -.. _dir-handlers-prrh: - -PythonPostReadRequestHandler ----------------------------- - -.. index:: - single: PythonPostReadRequestHandler - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This handler is called after the request has been read but before any -other phases have been processed. This is useful to make decisions -based upon the input header fields. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.OK`` or ``apache.DECLINED``, then -execution of all subsequent handlers for this phase is aborted. - -.. note:: - - When this phase of the request is processed, the URI has not yet - been translated into a path name, therefore this directive could - never be executed by Apache if it could specified within - ``<Directory>``, ``<Location>``, ``<File>`` directives or in an - :file:`.htaccess` file. The only place this directive is allowed is - the main configuration file, and the code for it will execute in - the main interpreter. And because this phase happens before any - identification of the type of content being requested is done - (i.e. is this a python program or a gif?), the python routine - specified with this handler will be called for *ALL* requests on - this server (not just python programs), which is an important - consideration if performance is a priority. - - - -.. _dir-handlers-th: - -PythonTransHandler ------------------- - -.. index:: - single: PythonTransHandler - - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - -This handler allows for an opportunity to translate the URI into -an actual filename, before the server's default rules (Alias -directives and the like) are followed. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.DECLINED``, then execution of all -subsequent handlers for this phase is aborted. - -.. note:: - - At the time when this phase of the request is being processed, the - URI has not been translated into a path name, therefore this - directive will never be executed by Apache if specified within - ``<Directory>``, ``<Location>``, ``<File>`` directives or in an - :file:`.htaccess` file. The only place this can be specified is the - main configuration file, and the code for it will execute in the - main interpreter. - - -.. _dir-handlers-hph: - -PythonHeaderParserHandler -------------------------- - -.. index:: - single: PythonHeaderParserHandler - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This handler is called to give the module a chance to look at the -request headers and take any appropriate specific actions early in the -processing sequence. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.OK`` or ``apache.DECLINED``, then -execution of all subsequent handlers for this phase is aborted. - - -.. _dir-handlers-pih: - -PythonInitHandler ------------------- - -.. index:: - single: PythonInitHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This handler is the first handler called in the request processing -phases that is allowed both inside and outside :file`.htaccess` and -directory. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.OK`` or ``apache.DECLINED``, then -execution of all subsequent handlers for this phase is aborted. - -This handler is actually an alias to two different handlers. When -specified in the main config file outside any directory tags, it is an -alias to ``PostReadRequestHandler``. When specified inside directory -(where ``PostReadRequestHandler`` is not allowed), it aliases to -``PythonHeaderParserHandler``. - -\*(This idea was borrowed from mod_perl) - - -.. _dir-handlers-ach: - -PythonAccessHandler -------------------- - -.. index:: - single: PythonAccessHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This routine is called to check for any module-specific restrictions -placed upon the requested resource. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.OK`` or ``apache.DECLINED``, then -execution of all subsequent handlers for this phase is aborted. - -For example, this can be used to restrict access by IP number. To do -so, you would return ``HTTP_FORBIDDEN`` or some such to indicate -that access is not allowed. - -.. _dir-handlers-auh: - -PythonAuthenHandler -------------------- - -.. index:: - single: PythonAuthenHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This routine is called to check the authentication information sent -with the request (such as looking up the user in a database and -verifying that the [encrypted] password sent matches the one in the -database). - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.DECLINED``, then execution of all -subsequent handlers for this phase is aborted. - -To obtain the username, use ``req.user``. To obtain the password -entered by the user, use the :meth:`request.get_basic_auth_pw` function. - -A return of ``apache.OK`` means the authentication succeeded. A return -of ``apache.HTTP_UNAUTHORIZED`` with most browser will bring up the -password dialog box again. A return of ``apache.HTTP_FORBIDDEN`` will -usually show the error on the browser and not bring up the password -dialog ``again. HTTP_FORBIDDEN`` should be used when authentication -succeeded, but the user is not permitted to access a particular URL. - -An example authentication handler might look like this:: - - def authenhandler(req): - - pw = req.get_basic_auth_pw() - user = req.user - if user == "spam" and pw == "eggs": - return apache.OK - else: - return apache.HTTP_UNAUTHORIZED - -.. note:: - - :meth:`request.get_basic_auth_pw` must be called prior to using the - :attr:`request.user` value. Apache makes no attempt to decode the - authentication information unless :meth:`request.get_basic_auth_pw` is called. - - -.. _dir-handlers-auzh: - -PythonAuthzHandler -------------------- - -.. index:: - single: PythonAuthzHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This handler runs after AuthenHandler and is intended for checking -whether a user is allowed to access a particular resource. But more -often than not it is done right in the AuthenHandler. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.DECLINED``, then execution of all -subsequent handlers for this phase is aborted. - -.. _dir-handlers-tph: - -PythonTypeHandler -------------------- - -.. index:: - single: PythonTypeHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This routine is called to determine and/or set the various document -type information bits, like Content-type (via ``r->content_type``), -language, et cetera. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.DECLINED``, then execution of all -subsequent handlers for this phase is aborted. - - -.. _dir-handlers-fuh: - -PythonFixupHandler -------------------- - -.. index:: - single: PythonFixupHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This routine is called to perform any module-specific fixing of header -fields, et cetera. It is invoked just before any content-handler. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.OK`` or ``apache.DECLINED``, then -execution of all subsequent handlers for this phase is aborted. - -.. _dir-handlers-ph: - -PythonHandler -------------- - -.. index:: - single: PythonHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This is the main request handler. Many applications will only provide -this one handler. - -Where multiple handlers are specified, if any handler in the sequence -returns a status value other than ``apache.OK`` or -``apache.DECLINED``, then execution of subsequent handlers for the phase -are skipped and the return status becomes that for the whole content -handler phase. If all handlers are run, the return status of the final -handler is what becomes the return status of the whole content handler -phase. Where that final status is ``apache.DECLINED``, Apache will fall -back to using the ``default-handler`` and attempt to serve up the target -as a static file. - -.. _dir-handlers-plh: - -PythonLogHandler ----------------- - -.. index:: - single: PythonLogHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This routine is called to perform any module-specific logging -activities. - -Where multiple handlers are specified, if any handler in the sequence -returns a value other than ``apache.OK`` or ``apache.DECLINED``, then -execution of all subsequent handlers for this phase is aborted. - -.. _dir-handlers-pch: - -PythonCleanupHandler --------------------- - -.. index:: - single: PythonCleanupHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ *Python\*Handler Syntax* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -This is the very last handler, called just before the request object -is destroyed by Apache. - -Unlike all the other handlers, the return value of this handler is -ignored. Any errors will be logged to the error log, but will not be -sent to the client, even if PythonDebug is On. - -This handler is not a valid argument to the ``rec.add_handler()`` -function. For dynamic clean up registration, use -``req.register_cleanup()``. - -Once cleanups have started, it is not possible to register more of -them. Therefore, ``req.register_cleanup()`` has no effect within this -handler. - -Cleanups registered with this directive will execute *after* cleanups -registered with ``req.register_cleanup()``. - -.. _dir-filter: - -Filters -======= - -.. _dir-filter-if: - -PythonInputFilter ------------------ - -.. index:: - single: PythonInputFilter - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonInputFilter handler name |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Registers an input filter *handler* under name *name*. *Handler* is a -module name optionally followed ``::`` and a callable object name. If -callable object name is omitted, it will default to -``'inputfilter'``. *Name* is the name under which the filter is -registered, by convention filter names are usually in all caps. - -The *module* referred to by the handler can be a full module name -(package dot notation is accepted) or an actual path to a module code file. -The module is loaded using the mod_python module importer as implemented by -the :func:`apache.import_module` function. Reference should be made to the -documentation of that function for further details of how module importing -is managed. - -To activate the filter, use the ``AddInputFilter`` directive. - -.. _dir-filter-of: - -PythonOutputFilter ------------------- - -.. index:: - single: PythonOutputFilter - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonOutputFilter handler name |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Registers an output filter *handler* under name *name*. *handler* is a -module name optionally followed ``::`` and a callable object name. If -callable object name is omitted, it will default to -``'outputfilter'``. *name* is the name under which the filter is -registered, by convention filter names are usually in all caps. - -The *module* referred to by the handler can be a full module name -(package dot notation is accepted) or an actual path to a module code file. -The module is loaded using the mod_python module importer as implemented by -the :func:`apache.import_module` function. Reference should be made to the -documentation of that function for further details of how module importing -is managed. - -To activate the filter, use the ``AddOutputFilter`` directive. - -.. _dir-conn: - -Connection Handler -================== - -.. _dir-conn-ch: - -PythonConnectionHandler ------------------------ - -.. index:: - single: PythonConnectionHandler - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonConnectionHandler handler |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Specifies that the connection should be handled with *handler* -connection handler. *handler* will be passed a single argument - -the connection object. - -*Handler* is a module name optionally followed ``::`` and a -callable object name. If callable object name is omitted, it will -default to ``'connectionhandler'``. - -The *module* can be a full module name (package dot notation is -accepted) or an absolute path to a module code file. The module is loaded -using the mod_python module importer as implemented by the -:func:`apache.import_module` function. Reference should be made to the -documentation of that function for further details of how module importing -is managed. - -.. _dir-other: - -Other Directives -================== - -.. _dir-other-epd: - -PythonEnablePdb ---------------- - -.. index:: - single: PythonEnablePdb - - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonEnablePdb {On, Off} |br| -`Default: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default>`_ PythonEnablePdb Off |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -When On, mod_python will execute the handler functions within the -Python debugger pdb using the :func:`pdb.runcall` function. - -Because pdb is an interactive tool, start httpd from the command line -with the ``-DONE_PROCESS`` option when using this directive. As soon as -your handler code is entered, you will see a Pdb prompt allowing you -to step through the code and examine variables. - -.. _dir-other-pd: - -PythonDebug ------------ - -.. index:: - single: PythonDebug - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonDebug {On, Off} |br| -`Default: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default>`_ PythonDebug Off |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Normally, the traceback output resulting from uncaught Python errors -is sent to the error log. With PythonDebug On directive specified, the -output will be sent to the client (as well as the log), except when -the error is :exc:`IOError` while writing, in which case it will go -to the error log. - -This directive is very useful during the development process. It is -recommended that you do not use it production environment as it may -reveal to the client unintended, possibly sensitive security -information. - -.. _dir-other-pimp: - -PythonImport ------------- - -.. index:: - single: PythonImport - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonImport *module* *interpreter_name* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Tells the server to import the Python module module at process startup -under the specified interpreter name. The import takes place at child -process initialization, so the module will actually be imported once for -every child process spawned. - -The *module* can be a full module name (package dot notation is -accepted) or an absolute path to a module code file. The module is loaded -using the mod_python module importer as implemented by the -:func:`apache.import_module` function. Reference should be made to -the documentation of that function for further details of how module -importing is managed. - -The ``PythonImport`` directive is useful for initialization tasks that -could be time consuming and should not be done at the time of processing a -request, e.g. initializing a database connection. Where such initialization -code could fail and cause the importing of the module to fail, it should be -placed in its own function and the alternate syntax used: - -``PythonImport *module::function* *interpreter_name*`` - -The named function will be called only after the module has been imported -successfully. The function will be called with no arguments. - -.. note:: - - At the time when the import takes place, the configuration is not - completely read yet, so all other directives, including - PythonInterpreter have no effect on the behavior of modules - imported by this directive. Because of this limitation, the - interpreter must be specified explicitly, and must match the name - under which subsequent requests relying on this operation will - execute. If you are not sure under what interpreter name a request - is running, examine the :attr:`request.interpreter` member of the request - object. - -See also Multiple Interpreters. - -.. _dir-other-ipd: - -PythonInterpPerDirectory ------------------------- - -.. index:: - single: PythonInterpPerDirectory - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonInterpPerDirectory {On, Off} |br| -`Default: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default>`_ PythonInterpPerDirectory Off |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Instructs mod_python to name subinterpreters using the directory of -the file in the request (``req.filename``) rather than the the -server name. This means that scripts in different directories will -execute in different subinterpreters as opposed to the default policy -where scripts in the same virtual server execute in the same -subinterpreter, even if they are in different directories. - -For example, assume there is a -:file:`/directory/subdirectory`. :file:`/directory` has an -``.htaccess`` file with a ``PythonHandler`` directive. -:file:`/directory/subdirectory` doesn't have an ``.htaccess``. By -default, scripts in :file:`/directory` and -:file:`/directory/subdirectory` would execute in the same interpreter -assuming both directories are accessed via the same virtual -server. With ``PythonInterpPerDirectory``, there would be two -different interpreters, one for each directory. - -.. note:: - - In early phases of the request prior to the URI translation - (PostReadRequestHandler and TransHandler) the path is not yet known - because the URI has not been translated. During those phases and - with PythonInterpPerDirectory on, all python code gets executed in - the main interpreter. This may not be exactly what you want, but - unfortunately there is no way around this. - - -.. seealso:: - - :ref:`pyapi-interps` - for more information - - -.. _dir-other-ipdv: - -PythonInterpPerDirective ------------------------- - -.. index:: - single: PythonInterpPerDirective - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonInterpPerDirective {On, Off} |br| -`Default: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default>`_ PythonInterpPerDirective Off |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Instructs mod_python to name subinterpreters using the directory in -which the Python*Handler directive currently in effect was -encountered. - -For example, assume there is a -:file:`/directory/subdirectory`. :file:`/directory` has an ``.htaccess`` -file with a ``PythonHandler`` directive. :file:`/directory/subdirectory` -has another :file:`.htaccess` file with another ``PythonHandler``. By -default, scripts in :file:`/directory` and -:file:`/directory/subdirectory` would execute in the same interpreter -assuming both directories are in the same virtual server. With -``PythonInterpPerDirective``, there would be two different interpreters, -one for each directive. - -.. seealso:: - - :ref:`pyapi-interps` - for more information - -.. _dir-other-pi: - -PythonInterpreter ------------------ - -.. index:: - single: PythonInterpreter - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonInterpreter *name* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Forces mod_python to use interpreter named *name*, overriding the -default behaviour or behaviour dictated by a :ref:`dir-other-ipd` or -:ref:`dir-other-ipdv` direcive. - -This directive can be used to force execution that would normally -occur in different subinterpreters to run in the same one. When -specified in the DocumentRoot, it forces the whole server to run in one -subinterpreter. - -.. seealso:: - - :ref:`pyapi-interps` - for more information - -.. _dir-other-phm: - -PythonHandlerModule -------------------- - -.. index:: - single: PythonHandlerModule - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonHandlerModule *module* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -PythonHandlerModule can be used an alternative to Python*Handler -directives. The module specified in this handler will be searched for -existence of functions matching the default handler function names, -and if a function is found, it will be executed. - -For example, instead of:: - - PythonAuthenHandler mymodule - PythonHandler mymodule - PythonLogHandler mymodule - - -one can simply use:: - - PythonHandlerModule mymodule - - -.. _dir-other-par: - -PythonAutoReload ----------------- - -.. index:: - single: PythonAutoReload - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonAutoReload {On, Off} |br| -`Default: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default>`_ PythonAutoReload On |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -If set to Off, instructs mod_python not to check the modification date -of the module file. - -By default, mod_python checks the time-stamp of the file and reloads -the module if the module's file modification date is later than the -last import or reload. This way changed modules get automatically -reimported, eliminating the need to restart the server for every -change. - -Disabling autoreload is useful in production environment where the -modules do not change; it will save some processing time and give a -small performance gain. - -.. _dir-other-pomz: - -PythonOptimize --------------- - -.. index:: - single: PythonOptimize - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonOptimize {On, Off} |br| -`Default: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default>`_ PythonOptimize Off |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Enables Python optimization. Same as the Python ``-O`` option. - -.. _dir-other-po: - -PythonOption ------------- - -.. index:: - single: PythonOption - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonOption key [value] |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -Assigns a key value pair to a table that can be later retrieved by the -:meth:`request.get_options` function. This is useful to pass information -between the apache configuration files (:file:`httpd.conf`, -:file:`.htaccess`, etc) and the Python programs. If the value is omitted or empty (``""``), -then the key is removed from the local configuration. - -Reserved PythonOption Keywords -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Some ``PythonOption`` keywords are used for configuring various aspects of -mod_python. Any keyword starting with mod_python.\* should be considered -as reserved for internal mod_python use. - -Users are encouraged to use their own namespace qualifiers when creating -add-on modules, and not pollute the global namespace. - -The following PythonOption keys are currently used by mod_python. - -| mod_python.mutex_directory -| mod_python.mutex_locks -| mod_python.psp.cache_database_filename -| mod_python.session.session_type -| mod_python.session.cookie_name -| mod_python.session.application_domain -| mod_python.session.application_path -| mod_python.session.database_directory -| mod_python.dbm_session.database_filename -| mod_python.dbm_session.database_directory -| mod_python.file_session.enable_fast_cleanup -| mod_python.file_session.verify_session_timeout -| mod_python.file_session.cleanup_grace_period -| mod_python.file_session.cleanup_time_limit -| mod_python.file_session.database_directory -| mod_python.wsgi.application -| mod_python.wsgi.base_uri - -| session *Deprecated in 3.3, use mod_python.session.session_type* -| ApplicationPath *Deprecated in 3.3, use mod_python.session.application_path* -| session_cookie_name *Deprecated in 3.3, use mod_python.session.cookie_name* -| session_directory *Deprecated in 3.3, use mod_python.session.database_directory* -| session_dbm *Deprecated in 3.3, use mod_python.dbm_session.database_filename* -| session_cleanup_time_limit *Deprecated in 3.3, use mod_python.file_session.cleanup_time_limit* -| session_fast_cleanup *Deprecated in 3.3, use mod_python.file_session.enable_fast_cleanup* -| session_grace_period *Deprecated in 3.3, use mod_python.file_session.cleanup_grace_period* -| session_verify_cleanup *Deprecated in 3.3, use mod_python.file_session.cleanup_session_timeout* -| PSPDbmCache *Deprecated in 3.3, use mod_python.psp.cache_database_filename* - - -.. _dir-other-pp: - -PythonPath ----------- - -.. index:: - single: PythonPath - -`Syntax: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax>`_ PythonPath *path* |br| -`Context: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context>`_ server config, virtual host, directory, htaccess |br| -`Override: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override>`_ not None |br| -`Module: <http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module>`_ mod_python.c |br| - - -PythonPath directive sets the PythonPath. The path must be specified -in Python list notation, e.g.:: - - PythonPath "['/usr/local/lib/python2.0', '/usr/local/lib/site_python', '/some/other/place']" - -The path specified in this directive will replace the path, not add to -it. However, because the value of the directive is evaled, to append a -directory to the path, one can specify something like:: - - PythonPath "sys.path+['/mydir']" - -Mod_python tries to minimize the number of evals associated with the -PythonPath directive because evals are slow and can negatively impact -performance, especially when the directive is specified in an -:file:`.htaccess` file which gets parsed at every hit. Mod_python will -remember the arguments to the PythonPath directive in the un-evaled -form, and before evaling the value it will compare it to the -remembered value. If the value is the same, no action is -taken. Because of this, you should not rely on the directive as a way -to restore the pythonpath to some value if your code changes it. - -When multiple PythonPath directives are specified, the effect is not -cumulative, last directive will override all previous ones. - -.. note:: - - This directive should not be used as a security measure since the - Python path is easily manipulated from within the scripts. - - - - - - - - - diff --git a/doc-html/_sources/handlers.txt b/doc-html/_sources/handlers.txt deleted file mode 100644 index 7aa31147be2691d783e3469b2ee68a1dc3725b11..0000000000000000000000000000000000000000 --- a/doc-html/_sources/handlers.txt +++ /dev/null @@ -1,489 +0,0 @@ - -.. _handlers: - -***************** -Standard Handlers -***************** - -.. _hand-pub: - -Publisher Handler -================= - -.. index:: - pair: publisher; handler - -The ``publisher`` handler is a good way to avoid writing your own -handlers and focus on rapid application development. It was inspired -by `Zope <http://www.zope.org/>`_ ZPublisher. - -.. _hand-pub-intro: - -Introduction ------------- - -To use the handler, you need the following lines in your configuration::: - - <Directory /some/path> - SetHandler mod_python - PythonHandler mod_python.publisher - </Directory> - - -This handler allows access to functions and variables within a module -via URL's. For example, if you have the following module, called -:file:`hello.py`::: - - """ Publisher example """ - - def say(req, what="NOTHING"): - return "I am saying %s" % what - - -A URL ``http://www.mysite.com/hello.py/say`` would return -``'I am saying NOTHING``. A URL -``http://www.mysite.com/hello.py/say?what=hello`` would -return ``'I am saying hello``. - - -.. _hand-pub-alg: - -The Publishing Algorithm ------------------------- - -The Publisher handler maps a URI directly to a Python variable or -callable object, then, respectively, returns it's string -representation or calls it returning the string representation of the -return value. - -.. index:: - pair: publisher; traversal - -.. _hand-pub-alg-trav: - -Traversal -^^^^^^^^^ - -The Publisher handler locates and imports the module specified in the -URI. The module location is determined from the :attr:`request.filename` -attribute. Before importing, the file extension, if any, is -discarded. - -If :attr:`request.filename` is empty, the module name defaults to -``'index'``. - -Once module is imported, the remaining part of the URI up to the -beginning of any query data (a.k.a. :const:`PATH_INFO`) is used to find an -object within the module. The Publisher handler *traverses* the -path, one element at a time from left to right, mapping the elements -to Python object within the module. - -If no ``path_info`` was given in the URL, the Publisher handler will use -the default value of ``'index'``. If the last element is an object inside -a module, and the one immediately preceding it is a directory -(i.e. no module name is given), then the module name will also default -to ``'index'``. - -The traversal will stop and :const:`HTTP_NOT_FOUND` will be returned to -the client if: - - -* Any of the traversed object's names begin with an underscore - (``'_'``). Use underscores to protect objects that should not be - accessible from the web. - -* A module is encountered. Published objects cannot be modules for - security reasons. - - -If an object in the path could not be found, :const:`HTTP_NOT_FOUND` -is returned to the client. - -For example, given the following configuration::: - - DocumentRoot /some/dir - - <Directory /some/dir> - SetHandler mod_python - PythonHandler mod_python.publisher - </Directory> - -And the following :file:`/some/dir/index.py` file::: - - def index(req): - return "We are in index()" - - def hello(req): - return "We are in hello()" - - -Then: - -* http://www.somehost/index/index will return ``'We are in index()'`` - -* http://www.somehost/index/ will return ``'We are in index()'`` - -* http://www.somehost/index/hello will return ``'We are in hello()'`` - -* http://www.somehost/hello will return ``'We are in hello()'`` - -* http://www.somehost/spam will return ``'404 Not Found'`` - - -.. _hand-pub-alg-args: - - -Argument Matching and Invocation -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Once the destination object is found, if it is callable and not a -class, the Publisher handler will get a list of arguments that the -object expects. This list is compared with names of fields from HTML -form data submitted by the client via ``POST`` or -``GET``. Values of fields whose names match the names of callable -object arguments will be passed as strings. Any fields whose names do -not match the names of callable argument objects will be silently dropped, -unless the destination callable object has a ``**kwargs`` style -argument, in which case fields with unmatched names will be passed in the -``**kwargs`` argument. - -If the destination is not callable or is a class, then its string -representation is returned to the client. - - -.. index:: - pair: publisher; authentication - -.. _hand-pub-alg-auth: - -Authentication -^^^^^^^^^^^^^^ - -The publisher handler provides simple ways to control access to -modules and functions. - -At every traversal step, the Publisher handler checks for presence of -``__auth__`` and ``__access__`` attributes (in this order), as -well as ``__auth_realm__`` attribute. - -If ``__auth__`` is found and it is callable, it will be called -with three arguments: the ``request`` object, a string containing -the user name and a string containing the password. If the return -value of -``__auth__`` is false, then :const:`HTTP_UNAUTHORIZED` is -returned to the client (which will usually cause a password dialog box -to appear). - -If :meth:`__auth__` is a dictionary, then the user name will be -matched against the key and the password against the value associated -with this key. If the key and password do not match, -:const:`HTTP_UNAUTHORIZED` is returned. Note that this requires -storing passwords as clear text in source code, which is not very secure. - -``__auth__`` can also be a constant. In this case, if it is false -(i.e. ``None``, ``0``, ``""``, etc.), then -:const:`HTTP_UNAUTHORIZED` is returned. - -If there exists an ``__auth_realm__`` string, it will be sent -to the client as Authorization Realm (this is the text that usually -appears at the top of the password dialog box). - -If ``__access__`` is found and it is callable, it will be called -with two arguments: the ``request`` object and a string containing -the user name. If the return value of ``__access__`` is false, then -:const:`HTTP_FORBIDDEN` is returned to the client. - -If ``__access__`` is a list, then the user name will be matched -against the list elements. If the user name is not in the list, -:const:`HTTP_FORBIDDEN` is returned. - -Similarly to ``__auth__``, ``__access__`` can be a constant. - -In the example below, only user ``'eggs'`` with password ``'spam'`` -can access the ``hello`` function::: - - __auth_realm__ = "Members only" - - def __auth__(req, user, passwd): - - 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 - - def hello(req): - return "hello" - -Here is the same functionality, but using an alternative technique::: - - __auth_realm__ = "Members only" - __auth__ = {"eggs":"spam", "joe":"eoj"} - __access__ = ["eggs"] - - def hello(req): - return "hello" - - -Since functions cannot be assigned attributes, to protect a function, -an ``__auth__`` or ``__access__`` function can be defined within -the function, e.g.::: - - def sensitive(req): - - 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` - -Note that this technique will also work if ``__auth__`` or -``__access__`` is a constant, but will not work is they are -a dictionary or a list. - -The ``__auth__`` and ``__access__`` mechanisms exist -independently of the standard -:ref:`dir-handlers-auh`. It -is possible to use, for example, the handler to authenticate, then the -``__access__`` list to verify that the authenticated user is -allowed to a particular function. - -.. note:: - - In order for mod_python to access ``__auth__``, the module - containing it must first be imported. Therefore, any module-level - code will get executed during the import even if - ``__auth__`` is false. To truly protect a module from being - accessed, use other authentication mechanisms, e.g. the Apache - ``mod_auth`` or with a mod_python :ref:`dir-handlers-auh`. - - -.. _hand-pub-form: - -Form Data ---------- - -In the process of matching arguments, the Publisher handler creates an -instance of :ref:`pyapi-util-fstor`. -A reference to this instance is stored in an attribute \member{form} -of the ``request`` object. - -Since a ``FieldStorage`` can only be instantiated once per -request, one must not attempt to instantiate ``FieldStorage`` when -using the Publisher handler and should use -:attr:`request.form` instead. - - -.. _hand-wsgi: - -WSGI Handler -============ - -.. index:: - pair: WSGI; handler - -WSGI handler can run WSGI applications as described in :pep:`333`. - -Assuming there exists the following minimal WSGI app residing in a file named -``mysite/wsgi.py`` in directory ``/path/to/mysite`` (so that the full -path to ``wsgi.py`` is ``/path/to/mysite/mysite/wsgi.py``):: - - def application(environ, start_response): - status = '200 OK' - output = 'Hello World!' - - response_headers = [('Content-type', 'text/plain'), - ('Content-Length', str(len(output)))] - start_response(status, response_headers) - - return [output] - -It can be executed using the WSGI handler by adding the following to the -Apache configuration:: - - PythonHandler mod_python.wsgi - PythonOption mod_python.wsgi.application mysite.wsgi - PythonPath "sys.path+['/path/to/mysite']" - -The above configuration will import a module named ``mysite.wsgi`` and -will look for an ``application`` callable in the module. - -An alternative name for the callable can be specified by appending it -to the module name separated by ``'::'``, e.g.:: - - PythonOption mod_python.wsgi.application mysite.wsgi::my_application - -If you would like your application to appear under a base URI, it can -be specified by wrapping your configuration in a ``<Location>`` -block. It can also be specified via the ``mod_python.wsgi.base_uri`` -option, but the ``<Location>`` method is recommended, also because it -has a side-benefit of informing mod_python to skip the map-to-storage -processing phase and thereby improving performance. - -For example, if you would like the above application to appear under -``'/wsgiapps'``, you could specify:: - - <Location /wsgiapps> - PythonHandler mod_python.wsgi - PythonOption mod_python.wsgi.application mysite.wsgi - PythonPath "sys.path+['/path/to/mysite']" - </Location> - -With the above configuration, content formerly under -``http://example.com/hello`` becomes available under -``http://example.com/wsgiapps/hello``. - -If both ``<Location>`` and ``mod_python.wsgi.base_uri`` exist, then -``mod_python.wsgi.base_uri`` takes precedence. -``mod_python.wsgi.base_uri`` cannot be ``'/'`` or end with a -``'/'``. "Root" (or no base_uri) is a blank string, which is the -default. (Note that it is allowed for ``<Location>`` path to be -``"/"`` or have a trailing slash, it will automatically be removed by -mod_python before computing ``PATH_INFO``). - - -.. index:: - pair: WSGI; SCRIPT_NAME - pair: WSGI; PATH_INFO - -.. note:: - - :pep:`333` describes ``SCRIPT_NAME`` and ``PATH_INFO`` environment - variables which are core to the specification. Most WSGI-supporting - frameworks currently in existence use the value of ``PATH_INFO`` as the - request URI. - - The two variable's name and function originate in CGI - (:rfc:`3875`), which describes an environment wherein a script (or - any executable's) output could be passed on by the web server as - content. A typical CGI script resides somewhere on the filesystem - to which the request URI maps. As part of serving the request the - server traverses the URI mapping each element to an element of the - filesystem path to locate the script. Once the script is found, the - portion of the URI used thus far is assigned to the ``SCRIPT_NAME`` - variable, while the remainder of the URI gets assigned to - ``PATH_INFO``. - - Because the relationship between Python modules and files on disk - is largely tangential, it is not very clear what exactly - ``PATH_INFO`` and ``SCRIPT_NAME`` ought to be. Even though Python - modules are most often files on disk located somewhere in the - Python path, they don't have to be (they could be code objects - constructed on-the-fly), and their location in the filesystem has - no relationship to the URL structure at all. - - The mismatch between CGI and WSGI results in an ambiguity which - requires that the split between the two variables be explicitely - specified, which is why ``mod_python.wsgi.base_uri`` exists. In essence - ``mod_python.wsgi.base_uri`` (or the path in surrounding - ``<Location>``) is the ``SCRIPT_NAME`` portion of the URI and - defaults to ``''``. - - An important detail is that ``SCRIPT_NAME`` + ``PATH_INFO`` should - result in the original URI (encoding issues aside). Since - ``SCRIPT_NAME`` (in its original CGI definition) referrs to an - actual file, its name never ends with a slash. The slash, if any, - always ends up in ``PATH_INFO``. E.g. ``/path/to/myscrip/foo/bar`` - splits into ``/path/to/myscript`` and ``/foo/bar``. If the whole - site is served by an app or a script, then ``SCRIPT_NAME`` is a - blank string ``''``, not a ``'/'``. - - -.. _hand-psp: - -PSP Handler -=========== - -.. index:: - pair: PSP; handler - -PSP handler is a handler that processes documents using the -``PSP`` class in ``mod_python.psp`` module. - -To use it, simply add this to your httpd configuration:: - - AddHandler mod_python .psp - PythonHandler mod_python.psp - -For more details on the PSP syntax, see Section :ref:`pyapi-psp`. - -If ``PythonDebug`` server configuration is ``On``, then by -appending an underscore (``'_'``) to the end of the url you can get a -nice side-by-side listing of original PSP code and resulting Python -code generated by the ``psp} module``. This is very useful for -debugging. You'll need to adjust your httpd configuration::: - - AddHandler mod_python .psp .psp_ - PythonHandler mod_python.psp - PythonDebug On - -.. note:: - - Leaving debug on in a production environment will allow remote users - to display source code of your PSP pages! - -.. _hand-cgi: - -CGI Handler -=========== - -.. index:: - pair: CGI; handler - - -CGI handler is a handler that emulates the CGI environment under mod_python. - -Note that this is not a ``'true'`` CGI environment in that it is -emulated at the Python level. ``stdin`` and ``stdout`` are -provided by substituting ``sys.stdin`` and ``sys.stdout``, and -the environment is replaced by a dictionary. The implication is that -any outside programs called from within this environment via -``os.system``, etc. will not see the environment available to the -Python program, nor will they be able to read/write from standard -input/output with the results expected in a ``'true'`` CGI environment. - -The handler is provided as a stepping stone for the migration of -legacy code away from CGI. It is not recommended that you settle on -using this handler as the preferred way to use mod_python for the long -term. This is because the CGI environment was not intended for -execution within threads (e.g. requires changing of current directory -with is inherently not thread-safe, so to overcome this cgihandler -maintains a thread lock which forces it to process one request at a -time in a multi-threaded server) and therefore can only be implemented -in a way that defeats many of the advantages of using mod_python in -the first place. - -To use it, simply add this to your :file:`.htaccess` file::: - - SetHandler mod_python - PythonHandler mod_python.cgihandler - -As of version 2.7, the cgihandler will properly reload even indirectly -imported module. This is done by saving a list of loaded modules -(sys.modules) prior to executing a CGI script, and then comparing it -with a list of imported modules after the CGI script is done. Modules -(except for whose whose __file__ attribute points to the standard -Python library location) will be deleted from sys.modules thereby -forcing Python to load them again next time the CGI script imports -them. - -If you do not want the above behavior, edit the :file:`cgihandler.py` -file and comment out the code delimited by ###. - -Tests show the cgihandler leaking some memory when processing a lot of -file uploads. It is still not clear what causes this. The way to work -around this is to set the Apache ``MaxRequestsPerChild`` to a non-zero -value. - - diff --git a/doc-html/_sources/installation.txt b/doc-html/_sources/installation.txt deleted file mode 100644 index 8332c63d78a4e7df503b8740ec938dcd91fc0a6e..0000000000000000000000000000000000000000 --- a/doc-html/_sources/installation.txt +++ /dev/null @@ -1,322 +0,0 @@ -.. _installation: - -************ -Installation -************ - -.. note:: - - By far the best place to get help with installation and other issues - is the mod_python mailing list. Please take a moment to join the - mod_python mailing list by sending an e-mail with the word - "subscribe" in the subject to mod_python-request@modpython.org or visit the - `mod_python mailing list page <http://mailman.modpython.org/mailman/listinfo/mod_python>`_ - - -.. _inst-prerequisites: - -Prerequisites -============= - -In the ideal case your Operating System provides a pre-packaged -version of mod_python. If not, you will need to compile it -yourself. This version of mod_python requires: - -* Python 2 (2.6 and up) or Python 3 (3.3 and up). -* Apache 2.2 or later. Apache 2.4 is highly recommended over 2.2. - -In order to compile mod_python you will need to have the include files -for both Apache and Python, as well as the Python library installed on -your system. If you installed Python and Apache from source, then you -already have everything needed. However, if you are using pre-packaged -software then you may need to install the "development" packages -which contain the include files and libraries necessary to compile -mod_python. Please check your OS documentation for specifics. (Hint: -look for packages named python-devel or python-dev and apache-devel or -apache-dev or httpd-dev, etc.). - -.. _inst-compiling: - -Compiling -========= - -.. _inst-configure: - -Running :file:`./configure` ---------------------------- - -The :file:`./configure` script will analyze your environment and -create custom Makefiles particular to your system. Aside from all the -standard autoconf stuff, :file:`./configure` does the following: - -.. index:: - single: apxs - pair: ./configure; --with-apxs - -* Finds out whether a program called :program:`apxs` is available. This - program is part of the standard Apache distribution, and is required - for compilation. - - You can manually specify the location of apxs by using the - :option:`with-apxs` option, e.g.:: - - $ ./configure --with-apxs=/usr/local/apache/bin/apxs - - It is recommended that you specify this option. - -.. index:: - single: libpython.a - pair: ./configure; --with-python - -* Checks your Python version and attempts to figure out where - :file:`libpython` is by looking at various parameters compiled into - your Python binary. By default, it will use the :program:`python` - program found in your :envvar:`PATH`. - - If the first Python binary in the path is not suitable or not the one - desired for mod_python, you can specify an alternative location with the - :option:`with-python` option, e.g.:: - - $ ./configure --with-python=/usr/local/bin/python2.3 - -.. index:: - pair: ./configure; --with-mutex-dir - -* Sets the directory for the apache mutex locks (if the mutex - mechanism chosen by APR requires one). - - Note: mutex locks are used only by :ref:`mod_python Sessions <pyapi-sess>` and - :ref:`PSP <hand-psp>` (which maintains a Session implicitly). If you're - not using mod_python Sessions or PSP, then this setting should not - matter. - - Default is :file:`/tmp`. The directory must exist and be - writable by the owner of the apache process. - - Use :option:`with-mutex-dir` option, e.g:: - - $ ./configure --with-mutex-dir=/var/run/mod_python - - The mutex directory can also be specified at run time using - :ref:`dir-other-po` ``mod_python.mutex_directory``. - See :ref:`inst-apacheconfig`. - - *New in version 3.3.0* - -.. index:: - pair: ./configure; --with-max-locks - -* Sets the maximum number of mutex locks reserved by mod_python. - - Note: mutex locks are used only by :ref:`mod_python Sessions <pyapi-sess>` and - :ref:`PSP <hand-psp>` (which maintains a Session implicitly). If you're - not using mod_python Sessions or PSP, then this setting should not - matter. - - The mutexes used for locking are a limited resource on some - systems. Increasing the maximum number of locks may increase performance - when using session locking. The default is 8. A reasonable number for - higher performance would be 32. - Use :option:`with-max-locks` option, e.g:: - - $ ./configure --with-max-locks=32 - - The number of locks can also be specified at run time using - :ref:`dir-other-po` ``mod_python.mutex_locks``. - See :ref:`inst-apacheconfig`. - - *New in version 3.2.0* - -.. index:: - single: flex - pair: ./configure; --with-flex - -* Attempts to locate :program:`flex` and determine its version. - If :program:`flex` cannot be found in your :envvar:`PATH` :program:`configure` - will fail. If the wrong version is found :program:`configure` will generate a warning. - You can generally ignore this warning unless you need to re-create - :file:`src/psp_parser.c`. - - The parser used by psp (See :ref:`pyapi-psp`) is written in C - generated using :program:`flex`. (This requires a reentrant version - of :program:`flex`, 2.5.31 or later). - - If the first flex binary in the path is not suitable or not the one desired - you can specify an alternative location with the option:with-flex: - option, e.g:: - - $ ./configure --with-flex=/usr/local/bin/flex - - *New in version 3.2.0* - -.. _inst-make: - -Running :file:`make` --------------------- - -.. index:: - single: make - -* To start the build process, simply run:: - - $ make - -.. _inst-installing: - -Installing -========== - -.. _inst-makeinstall: - -.. index:: - pair: make; install - -Running :file:`make install` - -* This part of the installation in most cases needs to be done as root:: - - $ sudo make install - - * This will copy the mod_python library (:file:`mod_python.so`) into your Apache - :file:`libexec` or :file:`modules` directory, where all the other modules are. - - * Lastly, it will install the Python libraries in - :file:`site-packages` and compile them. - -.. index:: - pair: make targets; install_py_lib - pair: make targets; install_dso - -.. note:: - - If you wish to selectively install just the Python libraries - or the DSO (mod_python.so) (which may not always require superuser - privileges), you can use the following :program:`make` targets: - :option:`install_py_lib` and :option:`install_dso`. - -.. _inst-apacheconfig: - -Configuring Apache -================== - -.. index:: - pair: LoadModule; apache configuration - single: mod_python.so - -* *LoadModule* - - You need to configure Apache to load the module by adding the - following line in the Apache configuration file, usually called - :file:`httpd.conf` or :file:`apache.conf`:: - - LoadModule python_module libexec/mod_python.so - - The actual path to :program:`mod_python.so` may vary, but :program:`make install` - should report at the very end exactly where :program:`mod_python.so` - was placed and how the ``LoadModule`` directive should appear. - -* See :ref:`inst-testing` below for more basic configuration parameters. - - -.. _inst-testing: - -Testing -======= - -#. Make a directory that would be visible on your web site, e.g. ``htdocs/test``. - -#. Add the following configuration directives to the main server config file:: - - <Directory /some/directory/htdocs/test> - AddHandler mod_python .py - PythonHandler mptest - PythonDebug On - </Directory> - - (Substitute ``/some/directory`` above for something applicable to - your system, usually your Apache ServerRoot) - - This configuration can also be specified in an :file:`.htaccess` - file. Note that :file:`.htaccess` configuration is typically - disabled by default, to enable it in a directory specify - ``AllowOverride`` with at least ``FileInfo``. - -#. This causes all requests for URLs ending in ``.py`` to be processed - by mod_python. Upon being handed a request, mod_python looks for - the appropriate *python handler* to handle it. Here, there is a - single ``PythonHandler`` directive defining module ``mptest`` as - the python handler to use. We'll see next how this python handler - is defined. - -#. At this time, if you made changes to the main configuration file, - you will need to restart Apache in order for the changes to take - effect. - -#. Edit :file:`mptest.py` file in the :file:`htdocs/test` directory so - that is has the following lines (be careful when cutting and - pasting from your browser, you may end up with incorrect - indentation and a syntax error):: - - from mod_python import apache - - def handler(req): - req.content_type = 'text/plain' - req.write("Hello World!") - return apache.OK - -#. Point your browser to the URL referring to the :file:`mptest.py`; - you should see ``'Hello World!'``. If you didn't - refer to the - troubleshooting section next. - -#. Note that according to the configuration written above, you can - point your browser to *any* URL ending in .py in the test - directory. Therefore pointing your browser to - :file:`/test/foobar.py` will be handled exactly the same way by - :file:`mptest.py`. This is because the code in the ``handler`` - function does not bother examining the URL and always acts the same - way no matter what the URL is. - -#. If everything worked well, move on to Chapter :ref:`tutorial`. - - -.. _inst-trouble: - -Troubleshooting -=============== - -There are a few things you can try to identify the problem: - -* Carefully study the error output, if any. - -* Check the server error log file, it may contain useful clues. - -* Try running Apache from the command line in single process mode:: - - ./httpd -X - - This prevents it from backgrounding itself and may provide some useful - information. - -* Beginning with mod_python 3.2.0, you can use the mod_python.testhandler - to diagnose your configuration. Add this to your :file:`httpd.conf` file:: - - <Location /mpinfo> - SetHandler mod_python - PythonHandler mod_python.testhandler - </Location> - - Now point your browser to the :file:`/mpinfo` URL - (e.g. :file:`http://localhost/mpinfo`) and note down the information given. - This will help you reporting your problem to the mod_python list. - -* Ask on the `mod_python list <http://mailman.modpython.org/mailman/listinfo/mod_python>`_. - Please make sure to provide specifics such as: - - * mod_python version. - * Your operating system type, name and version. - * Your Python version, and any unusual compilation options. - * Your Apache version. - * Relevant parts of the Apache config, .htaccess. - * Relevant parts of the Python code. - - diff --git a/doc-html/_sources/introduction.txt b/doc-html/_sources/introduction.txt deleted file mode 100644 index 3788edd3c2e1a5e2f39a1ff007a9a8dc6e011a16..0000000000000000000000000000000000000000 --- a/doc-html/_sources/introduction.txt +++ /dev/null @@ -1,65 +0,0 @@ -.. _introduction: - -************ -Introduction -************ - -.. _performance: - -Performance -=========== - -One of the main advantages of mod_python is the increase in -performance over traditional CGI. Below are results of a very crude -test. The test was done on a 1.2GHz Pentium machine running Red Hat -Linux 7.3. `Ab <http://httpd.apache.org/docs-2.0/programs/ab.html>`_ -was used to poll 4 kinds of scripts, all of which imported the -standard cgi module (because this is how a typical Python cgi script -begins), then output a single word ``'Hello!'``. The results are -based on 10000 requests with concurrency of 1:: - - Standard CGI: 23 requests/s - Mod_python cgihandler: 385 requests/s - Mod_python publisher: 476 requests/s - Mod_python handler: 1203 requests/s - - -.. _apache_api: - -Apache HTTP Server API -====================== - -Apache processes requests in *phases* (i.e. read the request, parse -headers, check access, etc.). Phases are implemented by -functions called *handlers*. Traditionally, handlers are written in C -and compiled into Apache modules. Mod_python provides a way to extend -Apache functionality by writing Apache handlers in Python. For a -detailed description of the Apache request processing process, see the -`Apache Developer Documentation <http://httpd.apache.org/docs/2.4/developer/>`_, as well as the -`Mod_python - Integrating Python with Apache <http://www.modpython.org/python10/>`_ -paper. - -Currently only a subset of the Apache HTTP Server API is accessible -via mod_python. It was never the goal of the project to provide a 100% -coverage of the API. Rather, mod_python is focused on the most useful -parts of the API and on providing the most "Pythonic" ways of using -it. - -.. _intro_other: - -Other Features -============== - -Mod_python also provides a number features that fall in the category -of web development, e.g. a parser for embedding Python in HTML -(:ref:`pyapi-psp`), a handler that maps URL space into modules and -functions (:ref:`hand-pub`), support for session (:ref:`pyapi-sess`) -and cookie (:ref:`pyapi-cookie`) handling. - -.. seealso:: - - `Apache HTTP Server Developer Documentation <http://httpd.apache.org/docs/2.4/developer/>`_ - for HTTP developer information - - `Mod_python - Integrating Python with Apache <http://www.modpython.org/python10/>`_ - for details on how mod_python interfaces with Apache HTTP Server diff --git a/doc-html/_sources/license.txt b/doc-html/_sources/license.txt deleted file mode 100644 index 9f48cf02526a53bbb64dfba0f18eebcf68fcd592..0000000000000000000000000000000000000000 --- a/doc-html/_sources/license.txt +++ /dev/null @@ -1,298 +0,0 @@ -.. highlightlang:: none - -.. _history-and-license: - -******************* -History and License -******************* - -History -======= - -Mod_python originates from a project called -`Httpdapy <http://www.modpython.org/httpdapy/>`_ (1997). For a -long time Httpdapy was not called mod_python because Httpdapy was not -meant to be Apache-specific. Httpdapy was designed to be -cross-platform and in fact was initially written for the Netscape -server (back then it was called Nsapy (1997)). - -Nsapy itself was based on an original concept and first code by Aaron -Watters from "Internet Programming with Python" by Aaron Watters, -Guido Van Rossum and James C. Ahlstrom, ISBN 1-55851-484-8. - -Without Aaron's inspiration, there would be no mod_python. Quoting -from the Httpdapy README file:: - - Although Nsapy only worked with Netscape servers, it was very - generic in its design and was based on some brilliant ideas that - weren't necessarily Netscape specific. Its design is a combination - of extensibility, simplicity and efficiency that takes advantage of - many of the key benefits of Python and is totally in the spirit of - Python. - -This excerpt from the Httpdapy README file describes well the -challenges and the solution provided by embedding Python within the -HTTP server:: - - While developing my first WWW applications a few years back, I - found that using CGI for programs that need to connect to - relational databases (commercial or not) is too slow because every - hit requires loading of the interpreter executable which can be - megabytes in size, any database libraries that can themselves be - pretty big, plus, the database connection/authentication process - carries a very significant overhead because it involves things like - DNS resolutions, encryption, memory allocation, etc.. Under - pressure to speed up the application, I nearly gave up the idea of - using Python for the project and started researching other tools - that claimed to specialize in www database integration. I did not - have any faith in MS's ASP; was quite frustrated by Netscape - LiveWire's slow performance and bugginess; Cold Fusion seemed - promising, but I soon learned that writing in html-like tags makes - programs as readable as assembly. Same is true for PHP. Besides, I - *really* wanted to write things in Python. - - Around the same time the Internet Programming With Python book came - out and the chapter describing how to embed Python within Netscape - server immediately caught my attention. I used the example in my - project, and developed an improved version of what I later called - Nsapy that compiled on both Windows NT and Solaris. - - Although Nsapy only worked with Netscape servers, it was a very - intelligent generic OO design that, in the spirit of Python, that - lent itself for easy portability to other web servers. - - Incidently, the popularity of Netscape's servers was taking a turn - south, and so I set out to port Nsapy to other servers starting - with the most popular one, Apache. And so from Nsapy was born - Httpdapy. - - -...continuing this saga, yours truly later learned that writing -Httpdapy for every server is a task a little bigger and less -interesting than I originally imagined. - -Instead, it seemed like providing a Python counterpart to the popular -Perl Apache extension mod_perl that would give Python users the same -(or better) capability would be a much more exciting thing to do. - -And so it was done. The first release of mod_python happened in May of -2000. - -License -======= - -Licensed under the Apache License, Version 2.0 (the "License"); you -may not use this file except in compliance with the License. You may -obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing -permissions and limitations under the License. - -Apache License:: - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/doc-html/_sources/pythonapi.txt b/doc-html/_sources/pythonapi.txt deleted file mode 100644 index 61d78f20443eb031683f25bc59b3d9aa1d263598..0000000000000000000000000000000000000000 --- a/doc-html/_sources/pythonapi.txt +++ /dev/null @@ -1,3362 +0,0 @@ - -.. _pythonapi: - -********** -Python API -********** - -.. _pyapi-interps: - -Multiple Interpreters -===================== - -When working with mod_python, it is important to be aware of a feature -of Python that is normally not used when using the language for -writing scripts to be run from command line. (In fact, this feature is not -available from within Python itself and can only be accessed through -the `C language API <http://www.python.org/doc/current/api/api.html>`_.) -Python C API provides the ability to create :dfn:`subinterpreters`. A -more detailed description of a subinterpreter is given in the -documentation for the -`Py_NewInterpreter() <http://www.python.org/doc/current/api/initialization.html>`_ -function. For this discussion, it will suffice to say that each -subinterpreter has its own separate namespace, not accessible from -other subinterpreters. Subinterpreters are very useful to make sure -that separate programs running under the same Apache server do not -interfere with one another. - -.. index:: - single: main_interpreter - -At server start-up or mod_python initialization time, mod_python -initializes the *main interpeter*. The main interpreter contains a -dictionary of subinterpreters. Initially, this dictionary is -empty. With every request, as needed, subinterpreters are created, and -references to them are stored in this dictionary. The dictionary is -keyed on a string, also known as *interpreter name*. This name can be -any string. The main interpreter is named ``'main_interpreter'``. -The way all other interpreters are named can be controlled by -``PythonInterp*`` directives. Default behavior is to name -interpreters using the Apache virtual server name (``ServerName`` -directive). This means that all scripts in the same virtual server -execute in the same subinterpreter, but scripts in different virtual -servers execute in different subinterpreters with completely separate -namespaces. :ref:`dir-other-ipd` and :ref:`dir-other-ipdv` directives -alter the naming convention to use the absolute path of the directory -being accessed, or the directory in which the ``Python*Handler`` was -encountered, respectively. :ref:`dir-other-pi` can be used to force -the interpreter name to a specific string overriding any naming -conventions. - -Once created, a subinterpreter will be reused for subsequent requests. -It is never destroyed and exists until the Apache process ends. - -You can find out the name of the interpreter under which you're -running by peeking at :attr:`request.interpreter`. - -.. note:: - - If any module is being used which has a C code component that uses - the simplified API for access to the Global Interpreter Lock (GIL) - for Python extension modules, then the interpreter name must be - forcibly set to be ``'main_interpreter'``. This is necessary as such - a module will only work correctly if run within the context of the - first Python interpreter created by the process. If not forced to - run under the ``'main_interpreter'``, a range of Python errors can - arise, each typically referring to code being run in *restricted - mode*. - -.. seealso:: - - `<http://www.python.org/doc/current/api/api.html>`_ - Python C Language API - `<http://www.python.org/peps/pep-0311.html>`_ - PEP 0311 - Simplified Global Interpreter Lock Acquisition for Extensions - -.. _pyapi-handler: - -Overview of a Request Handler -============================= - -.. index:: - pair: request; handler - -A :dfn:`handler` is a function that processes a particular phase of a -request. Apache processes requests in phases - read the request, -process headers, provide content, etc. For every phase, it will call -handlers, provided by either the Apache core or one of its modules, -such as mod_python which passes control to functions provided by the -user and written in Python. A handler written in Python is not any -different from a handler written in C, and follows these rules: - -.. index:: - single: req - pair: request; object - -A handler function will always be passed a reference to a request -object. (Throughout this manual, the request object is often referred -to by the ``req`` variable.) - -Every handler can return: - -* :const:`apache.OK`, meaning this phase of the request was handled by this - handler and no errors occurred. - -* :const:`apache.DECLINED`, meaning this handler has not handled this - phase of the request to completion and Apache needs to look for - another handler in subsequent modules. - -* :const:`apache.HTTP_ERROR`, meaning an HTTP error occurred. - *HTTP_ERROR* can be any of the following:: - - HTTP_CONTINUE = 100 - HTTP_SWITCHING_PROTOCOLS = 101 - HTTP_PROCESSING = 102 - HTTP_OK = 200 - HTTP_CREATED = 201 - HTTP_ACCEPTED = 202 - HTTP_NON_AUTHORITATIVE = 203 - HTTP_NO_CONTENT = 204 - HTTP_RESET_CONTENT = 205 - HTTP_PARTIAL_CONTENT = 206 - HTTP_MULTI_STATUS = 207 - HTTP_MULTIPLE_CHOICES = 300 - HTTP_MOVED_PERMANENTLY = 301 - HTTP_MOVED_TEMPORARILY = 302 - HTTP_SEE_OTHER = 303 - HTTP_NOT_MODIFIED = 304 - HTTP_USE_PROXY = 305 - HTTP_TEMPORARY_REDIRECT = 307 - HTTP_BAD_REQUEST = 400 - HTTP_UNAUTHORIZED = 401 - HTTP_PAYMENT_REQUIRED = 402 - HTTP_FORBIDDEN = 403 - HTTP_NOT_FOUND = 404 - HTTP_METHOD_NOT_ALLOWED = 405 - HTTP_NOT_ACCEPTABLE = 406 - HTTP_PROXY_AUTHENTICATION_REQUIRED= 407 - HTTP_REQUEST_TIME_OUT = 408 - HTTP_CONFLICT = 409 - HTTP_GONE = 410 - HTTP_LENGTH_REQUIRED = 411 - HTTP_PRECONDITION_FAILED = 412 - HTTP_REQUEST_ENTITY_TOO_LARGE = 413 - HTTP_REQUEST_URI_TOO_LARGE = 414 - HTTP_UNSUPPORTED_MEDIA_TYPE = 415 - HTTP_RANGE_NOT_SATISFIABLE = 416 - HTTP_EXPECTATION_FAILED = 417 - HTTP_UNPROCESSABLE_ENTITY = 422 - HTTP_LOCKED = 423 - HTTP_FAILED_DEPENDENCY = 424 - HTTP_INTERNAL_SERVER_ERROR = 500 - HTTP_NOT_IMPLEMENTED = 501 - HTTP_BAD_GATEWAY = 502 - HTTP_SERVICE_UNAVAILABLE = 503 - HTTP_GATEWAY_TIME_OUT = 504 - HTTP_VERSION_NOT_SUPPORTED = 505 - HTTP_VARIANT_ALSO_VARIES = 506 - HTTP_INSUFFICIENT_STORAGE = 507 - HTTP_NOT_EXTENDED = 510 - -As an alternative to *returning* an HTTP error code, handlers can -signal an error by *raising* the :const:`apache.SERVER_RETURN` -exception, and providing an HTTP error code as the exception value, -e.g.:: - - raise apache.SERVER_RETURN, apache.HTTP_FORBIDDEN - -Handlers can send content to the client using the :meth:`request.write()` -method. - -Client data, such as POST requests, can be read by using the -:meth:`request.read()` function. - -An example of a minimalistic handler might be:: - - from mod_python import apache - - def requesthandler(req): - req.content_type = "text/plain" - req.write("Hello World!") - return apache.OK - -.. _pyapi-filter: - -Overview of a Filter Handler -============================ - -.. index:: - pair: filter; handler - -A :dfn:`filter handler` is a function that can alter the input or the -output of the server. There are two kinds of filters - :dfn:`input` and -:dfn:`output` that apply to input from the client and output to the -client respectively. - -At this time mod_python supports only request-level filters, meaning -that only the body of HTTP request or response can be filtered. Apache -provides support for connection-level filters, which will be supported -in the future. - -A filter handler receives a *filter* object as its argument. The -request object is available as well via ``filter.req``, but all -writing and reading should be done via the filter's object read and -write methods. - -Filters need to be closed when a read operation returns None -(indicating End-Of-Stream). - -The return value of a filter is ignored. Filters cannot decline -processing like handlers, but the same effect can be achieved -by using the :meth:`filter.pass_on()` method. - -Filters must first be registered using ``PythonInputFilter`` or -``PythonOutputFilter``, then added using the Apache -``Add/SetInputFilter`` or ``Add/SetOutputFilter`` directives. - -Here is an example of how to specify an output filter, it tells the -server that all .py files should processed by CAPITALIZE filter:: - - PythonOutputFilter capitalize CAPITALIZE - AddOutputFilter CAPITALIZE .py - -And here is what the code for the :file:`capitalize.py` might look -like:: - - from mod_python import apache - - def outputfilter(filter): - - s = filter.read() - while s: - filter.write(s.upper()) - s = filter.read() - - if s is None: - filter.close() - -When writing filters, keep in mind that a filter will be called any -time anything upstream requests an IO operation, and the filter has no -control over the amount of data passed through it and no notion of -where in the request processing it is called. For example, within a -single request, a filter may be called once or five times, and there -is no way for the filter to know beforehand that the request is over -and which of calls is last or first for this request, thought -encounter of an EOS (None returned from a read operation) is a fairly -strong indication of an end of a request. - -Also note that filters may end up being called recursively in -subrequests. To avoid the data being altered more than once, always -make sure you are not in a subrequest by examining the :attr:`request.main` -value. - -For more information on filters, see `<http://httpd.apache.org/docs-2.4/developer/filters.html>`_. - -.. _pyapi-conn: - -Overview of a Connection Handler -================================ - -.. index:: - pair: connection; handler - -A :dfn:`connection handler` handles the connection, starting almost -immediately from the point the TCP connection to the server was -made. - -Unlike HTTP handlers, connection handlers receive a *connection* -object as an argument. - -Connection handlers can be used to implement protocols. Here is an -example of a simple echo server: - -Apache configuration:: - - PythonConnectionHandler echo - -Contents of :file:`echo.py` file:: - - from mod_python import apache - - def connectionhandler(conn): - - while 1: - conn.write(conn.readline()) - - return apache.OK - -:mod:`apache` -- Access to Apache Internals. -=============================================== - -.. module:: apache - :synopsis: Access to Apache Internals. -.. moduleauthor:: Gregory Trubetskoy grisha@modpython.org - -The Python interface to Apache internals is contained in a module -appropriately named :mod:`apache`, located inside the -:mod:`mod_python` package. This module provides some important -objects that map to Apache internal structures, as well as some useful -functions, all documented below. (The request object also provides an -interface to Apache internals, it is covered in its own section of -this manual.) - -.. index:: - pair: _apache; module - -The :mod:`apache` module can only be imported by a script running -under mod_python. This is because it depends on a built-in module -:mod:`_apache` provided by mod_python. - -It is best imported like this:: - - from mod_python import apache - -:mod:`mod_python.apache` module defines the following functions and -objects. For a more in-depth look at Apache internals, see the -`Apache Developer Page <http://httpd.apache.org/dev/>`_ - -.. _pyapi-apmeth: - -Functions ---------- - -.. function:: log_error(message[, level[, server]]) - - An interface to the Apache ``ap_log_error()`` - function. *message* is a string with the error message, - *level* is one of the following flags constants:: - - APLOG_EMERG - APLOG_ALERT - APLOG_CRIT - APLOG_ERR - APLOG_WARNING - APLOG_NOTICE - APLOG_INFO - APLOG_DEBUG - APLOG_NOERRNO // DEPRECATED - - *server* is a reference to a :meth:`request.server` object. If - *server* is not specified, then the error will be logged to the - default error log, otherwise it will be written to the error log for - the appropriate virtual server. When *server* is not specified, - the setting of LogLevel does not apply, the LogLevel is dictated by - an httpd compile-time default, usually ``warn``. - - If you have a reference to a request object available, consider using - :meth:`request.log_error` instead, it will prepend request-specific - information such as the source IP of the request to the log entry. - -.. function:: import_module(module_name[, autoreload=1, log=0, path=None]) - - This function can be used to import modules taking advantage of - mod_python's internal mechanism which reloads modules automatically - if they have changed since last import. - - *module_name* is a string containing the module name (it can - contain dots, e.g. ``mypackage.mymodule``); *autoreload* indicates - whether the module should be reloaded if it has changed since last - import; when *log* is true, a message will be written to the - logs when a module is reloaded; *path* allows restricting - modules to specific paths. - - Example:: - - from mod_python import apache - module = apache.import_module('module_name', log=1) - -.. function:: allow_methods([*args]) - - A convenience function to set values in :meth:`request.allowed`. - :meth:`request.allowed` is a bitmask that is used to construct the - ``'Allow:'`` header. It should be set before returning a - :const:`HTTP_NOT_IMPLEMENTED` error. - - Arguments can be one or more of the following:: - - M_GET - M_PUT - M_POST - M_DELETE - M_CONNECT - M_OPTIONS - M_TRACE - M_PATCH - M_PROPFIND - M_PROPPATCH - M_MKCOL - M_COPY - M_MOVE - M_LOCK - M_UNLOCK - M_VERSION_CONTROL - M_CHECKOUT - M_UNCHECKOUT - M_CHECKIN - M_UPDATE - M_LABEL - M_REPORT - M_MKWORKSPACE - M_MKACTIVITY - M_BASELINE_CONTROL - M_MERGE - M_INVALID - -.. function:: exists_config(name) - - This function returns True if the Apache server was launched with - the definition with the given *name*. This means that you can - test whether Apache was launched with the ``-DFOOBAR`` parameter - by calling ``apache.exists_config_define('FOOBAR')``. - -.. function:: stat(fname, wanted) - - This function returns an instance of an ``mp_finfo`` object - describing information related to the file with name ``fname``. - The ``wanted`` argument describes the minimum attributes which - should be filled out. The resultant object can be assigned to the - :attr:`request.finfo` attribute. - -.. function:: register_cleanup(callable[, data]) - - Registers a cleanup that will be performed at child shutdown - time. Equivalent to :func:`server.register_cleanup`, except - that a request object is not required. *Warning:* do not pass - directly or indirectly a request object in the data - parameter. Since the callable will be called at server shutdown - time, the request object won't exist anymore and any manipulation - of it in the handler will give undefined behaviour. - -.. function:: config_tree() - - Returns the server-level configuration tree. This tree does not - include directives from .htaccess files. This is a *copy* of the - tree, modifying it has no effect on the actual configuration. - -.. function:: server_root() - - Returns the value of ServerRoot. - -.. function:: make_table() - - This function is obsolete and is an alias to :class:`table` (see below). - -.. function:: mpm_query(code) - - Allows querying of the MPM for various parameters such as numbers of - processes and threads. The return value is one of three constants:: - - AP_MPMQ_NOT_SUPPORTED = 0 # This value specifies whether - # an MPM is capable of - # threading or forking. - AP_MPMQ_STATIC = 1 # This value specifies whether - # an MPM is using a static # of - # threads or daemons. - AP_MPMQ_DYNAMIC = 2 # This value specifies whether - # an MPM is using a dynamic # of - # threads or daemons. - - The *code* argument must be one of the following:: - - AP_MPMQ_MAX_DAEMON_USED = 1 # Max # of daemons used so far - AP_MPMQ_IS_THREADED = 2 # MPM can do threading - AP_MPMQ_IS_FORKED = 3 # MPM can do forking - AP_MPMQ_HARD_LIMIT_DAEMONS = 4 # The compiled max # daemons - AP_MPMQ_HARD_LIMIT_THREADS = 5 # The compiled max # threads - AP_MPMQ_MAX_THREADS = 6 # # of threads/child by config - AP_MPMQ_MIN_SPARE_DAEMONS = 7 # Min # of spare daemons - AP_MPMQ_MIN_SPARE_THREADS = 8 # Min # of spare threads - AP_MPMQ_MAX_SPARE_DAEMONS = 9 # Max # of spare daemons - AP_MPMQ_MAX_SPARE_THREADS = 10 # Max # of spare threads - AP_MPMQ_MAX_REQUESTS_DAEMON= 11 # Max # of requests per daemon - AP_MPMQ_MAX_DAEMONS = 12 # Max # of daemons by config - - Example:: - - if apache.mpm_query(apache.AP_MPMQ_IS_THREADED): - # do something - else: - # do something else - -.. _pyapi-apmem: - -Attributes ----------- - -.. attribute:: interpreter - - String. The name of the subinterpreter under which we're running. - *(Read-Only)* - -.. attribute:: main_server - - A ``server`` object for the main server. - *(Read-Only)* - -.. attribute:: MODULE_MAGIC_NUMBER_MAJOR - - Integer. An internal to Apache version number useful to determine whether - certain features should be available. See :attr:`MODULE_MAGIC_NUMBER_MINOR`. - - Major API changes that could cause compatibility problems for older - modules such as structure size changes. No binary compatibility is - possible across a change in the major version. - - *(Read-Only)* - - -.. attribute:: MODULE_MAGIC_NUMBER_MINOR - - Integer. An internal to Apache version number useful to determine whether - certain features should be available. See :attr:`MODULE_MAGIC_NUMBER_MAJOR`. - - Minor API changes that do not cause binary compatibility problems. - - *(Read-Only)* - - -.. _pyapi-mptable: - -Table Object (mp_table) ------------------------ -.. index:: - singe: table - -.. class:: table([mapping-or-sequence]) - - Returns a new empty object of type ``mp_table``. See Section - :ref:`pyapi-mptable` for description of the table object. The - *mapping-or-sequence* will be used to provide initial values for - the table. - - The table object is a wrapper around the Apache APR table. The - table object behaves very much like a dictionary (including the - Python 2.2 features such as support of the ``in`` operator, etc.), - with the following differences: - - * Both keys and values must be strings. - * Key lookups are case-insensitive. - * Duplicate keys are allowed (see :meth:`table.add()` below). When there is - more than one value for a key, a subscript operation returns a list. - - Much of the information that Apache uses is stored in tables. For - example, :meth:`request.headers_in` and :meth:`request.headers_out`. - - All the tables that mod_python provides inside the request object - are actual mappings to the Apache structures, so changing the - Python table also changes the underlying Apache table. - - In addition to normal dictionary-like behavior, the table object - also has the following method: - - .. method:: add(key, val) - - Allows for creating duplicate keys, which is useful - when multiple headers, such as `Set-Cookie:` are required. - -.. _pyapi-mprequest: - -Request Object --------------- - -.. index:: - single: req - single: request - single: request_rec - -The request object is a Python mapping to the Apache `request_rec` -structure. When a handler is invoked, it is always passed a single -argument - the request object. For brevity, we often refer to it here -and throughout the code as ``req``. - -You can dynamically assign attributes to it as a way to communicate -between handlers. - -.. _pyapi-mprequest-meth: - -Request Methods -^^^^^^^^^^^^^^^ - -.. method:: request.add_cgi_vars() - - Calls Apache function ``ap_add_common_vars()`` followed some code - very similar to Apache ``ap_add_cgi_vars()`` with the exception of - calculating ``PATH_TRANSLATED`` value, thereby avoiding - sub-requests and filesystem access used in the ``ap_add_cgi_vars()`` - implementation. - -.. method:: request.add_common_vars() - - Use of this method is discouraged, use - :meth:`request.add_cgi_vars()` instead. - - Calls the Apache ``ap_add_common_vars()`` function. After a call to - this method, :attr:`request.subprocess_env` will contain *some* CGI - information. - -.. method:: request.add_handler(htype, handler[, dir]) - - Allows dynamic handler registration. *htype* is a string - containing the name of any of the apache request (but not filter or - connection) handler directives, - e.g. ``'PythonHandler'``. *handler* is a string containing the - name of the module and the handler function. Optional *dir* is - a string containing the name of the directory to be added to the - pythonpath. If no directory is specified, then, if there is already - a handler of the same type specified, its directory is inherited, - otherwise the directory of the presently executing handler is - used. If there is a ``'PythonPath'`` directive in effect, then - ``sys.path`` will be set exactly according to it (no directories - added, the *dir* argument is ignored). - - A handler added this way only persists throughout the life of the - request. It is possible to register more handlers while inside the - handler of the same type. One has to be careful as to not to create - an infinite loop this way. - - Dynamic handler registration is a useful technique that allows the - code to dynamically decide what will happen next. A typical example - might be a ``PythonAuthenHandler`` that will assign different - ``PythonHandlers`` based on the authorization level, something - like:: - - if manager: - req.add_handler("PythonHandler", "menu::admin") - else: - req.add_handler("PythonHandler", "menu::basic") - - .. note:: - - If you pass this function an invalid handler, an exception will be - generated at the time an attempt is made to find the handler. - - -.. method:: request.add_input_filter(filter_name) - - Adds the named filter into the input filter chain for the current - request. The filter should be added before the first attempt to - read any data from the request. - - -.. method:: request.add_output_filter(filter_name) - - Adds the named filter into the output filter chain for the current - request. The filter should be added before the first attempt to - write any data for the response. - - Provided that all data written is being buffered and not flushed, - this could be used to add the "CONTENT_LENGTH" filter into the - chain of output filters. The purpose of the "CONTENT_LENGTH" filter - is to add a ``Content-Length:`` header to the response.:: - - - req.add_output_filter("CONTENT_LENGTH") - req.write("content",0) - -.. method:: request.allow_methods(methods[, reset]) - - Adds methods to the :meth:`request.allowed_methods` list. This list - will be passed in `Allowed:` header if - :const:`HTTP_METHOD_NOT_ALLOWED` or :const:`HTTP_NOT_IMPLEMENTED` - is returned to the client. Note that Apache doesn't do anything to - restrict the methods, this list is only used to construct the - header. The actual method-restricting logic has to be provided in - the handler code. - - *methods* is a sequence of strings. If *reset* is 1, then - the list of methods is first cleared. - - -.. method:: request.auth_name() - - Returns AuthName setting. - - -.. method:: request.auth_type() - - Returns AuthType setting. - - -.. method:: request.construct_url(uri) - - This function returns a fully qualified URI string from the path - specified by uri, using the information stored in the request to - determine the scheme, server name and port. The port number is not - included in the string if it is the same as the default port 80. - - For example, imagine that the current request is directed to the - virtual server www.modpython.org at port 80. Then supplying - ``'/index.html'`` will yield the string - ``'http://www.modpython.org/index.html'``. - - -.. method:: request.discard_request_body() - - Tests for and reads any message body in the request, simply discarding - whatever it receives. - - -.. method:: request.document_root() - - Returns DocumentRoot setting. - - -.. method:: request.get_basic_auth_pw() - - Returns a string containing the password when Basic authentication is - used. - - On Python 3 the string will be decoded to Unicode using Latin1. - -.. method:: request.get_config() - - Returns a reference to the table object containing the mod_python - configuration in effect for this request except for - ``Python*Handler`` and ``PythonOption`` (The latter can be obtained - via :meth:`request.get_options()`. The table has directives as keys, - and their values, if any, as values. - - -.. method:: request.get_remote_host([type[, str_is_ip]]) - - This method is used to determine remote client's DNS name or IP - number. The first call to this function may entail a DNS look up, - but subsequent calls will use the cached result from the first - call. - - The optional *type* argument can specify the following: - - * :const:`apache.REMOTE_HOST` Look up the DNS name. Return None if Apache - directive ``HostNameLookups`` is ``Off`` or the hostname cannot - be determined. - - * :const:`apache.REMOTE_NAME` *(Default)* Return the DNS name if - possible, or the IP (as a string in dotted decimal notation) - otherwise. - - * :const:`apache.REMOTE_NOLOOKUP` Don't perform a DNS lookup, return an - IP. Note: if a lookup was performed prior to this call, then the - cached host name is returned. - - * :const:`apache.REMOTE_DOUBLE_REV` Force a double-reverse lookup. On - failure, return None. - - If *str_is_ip* is ``None`` or unspecified, then the return - value is a string representing the DNS name or IP address. - - If the optional *str_is_ip* argument is not ``None``, then - the return value is an ``(address, str_is_ip)`` tuple, where - ``str_is_ip`` is non-zero if ``address`` is an IP address - string. - - On failure, ``None`` is returned. - - -.. method:: request.get_options() - - Returns a reference to the table object containing the options set by - the ``PythonOption`` directives. - - -.. method:: request.internal_redirect(new_uri) - - Internally redirects the request to the *new_uri*. *new_uri* - must be a string. - - The httpd server handles internal redirection by creating a new - request object and processing all request phases. Within an - internal redirect, :meth:`request.prev` will contain a reference to a - request object from which it was redirected. - - -.. method:: request.is_https() - - Returns non-zero if the connection is using SSL/TLS. Will always return - zero if the mod_ssl Apache module is not loaded. - - You can use this method during any request phase, unlike looking - for the ``HTTPS`` variable in the :attr:`request.subprocess_env` member - dictionary. This makes it possible to write an authentication or - access handler that makes decisions based upon whether SSL is being - used. - - Note that this method will not determine the quality of the - encryption being used. For that you should call the - `ssl_var_lookup` method to get one of the `SSL_CIPHER*` variables. - - -.. method:: request.log_error(message[, level]) - - An interface to the Apache `ap_log_rerror` function. *message* is a - string with the error message, *level* is one of the following - flags constants:: - - - APLOG_EMERG - APLOG_ALERT - APLOG_CRIT - APLOG_ERR - APLOG_WARNING - APLOG_NOTICE - APLOG_INFO - APLOG_DEBUG - APLOG_NOERRNO - - If you need to write to log and do not have a reference to a request object, - use the :func:`apache.log_error` function. - - -.. method:: request.meets_conditions() - - Calls the Apache ``ap_meets_conditions()`` function which returns a - status code. If *status* is :const:`apache.OK`, generate the - content of the response normally. If not, simply return *status*. - Note that *mtime* (and possibly the ETag header) should be set as - appropriate prior to calling this function. The same goes for - :meth:`request.status` if the status differs from :const:`apache.OK`. - - Example:: - - # ... - r.headers_out['ETag'] = '"1130794f-3774-4584-a4ea-0ab19e684268"' - r.headers_out['Expires'] = 'Mon, 18 Apr 2005 17:30:00 GMT' - r.update_mtime(1000000000) - r.set_last_modified() - - status = r.meets_conditions() - if status != apache.OK: - return status - - # ... do expensive generation of the response content ... - - -.. method:: request.requires() - - Returns a tuple of strings of arguments to ``require`` directive. - - For example, with the following apache configuration:: - - AuthType Basic - require user joe - require valid-user - - :meth:`request.requires()` would return ``('user joe', 'valid-user')``. - - -.. method:: request.read([len]) - - Reads at most *len* bytes directly from the client, returning a - string with the data read. If the *len* argument is negative or - omitted, reads all data given by the client. - - This function is affected by the ``Timeout`` Apache - configuration directive. The read will be aborted and an - :exc:`IOError` raised if the :exc:`Timeout` is reached while - reading client data. - - This function relies on the client providing the ``Content-length`` - header. Absence of the ``Content-length`` header will be treated as - if ``Content-length: 0`` was supplied. - - Incorrect ``Content-length`` may cause the function to try to read - more data than available, which will make the function block until - a ``Timeout`` is reached. - - On Python 3 the output is always bytes. - -.. method:: request.readline([len]) - - Like :meth:`request.read()` but reads until end of line. - - .. note:: - - In accordance with the HTTP specification, most clients will be - terminating lines with ``'\r\n'`` rather than simply - ``'\n'``. - - -.. method:: request.readlines([sizehint]) - - Reads all lines using :meth:`request.readline()` and returns a list of - the lines read. If the optional *sizehint* parameter is given in, - the method will read at least *sizehint* bytes of data, up to the - completion of the line in which the *sizehint* bytes limit is - reached. - - -.. method:: request.register_cleanup(callable[, data]) - - Registers a cleanup. Argument *callable* can be any callable - object, the optional argument *data* can be any object (default is - ``None``). At the very end of the request, just before the actual - request record is destroyed by Apache, *callable* will be - called with one argument, *data*. - - It is OK to pass the request object as data, but keep in mind that - when the cleanup is executed, the request processing is already - complete, so doing things like writing to the client is completely - pointless. - - If errors are encountered during cleanup processing, they should be - in error log, but otherwise will not affect request processing in - any way, which makes cleanup bugs sometimes hard to spot. - - If the server is shut down before the cleanup had a chance to run, - it's possible that it will not be executed. - - -.. method:: request.register_input_filter(filter_name, filter[, dir]) - - Allows dynamic registration of mod_python input - filters. *filter_name* is a string which would then subsequently be - used to identify the filter. *filter* is a string containing - the name of the module and the filter function. Optional *dir* - is a string containing the name of the directory to be added to the - pythonpath. If there is a ``PythonPath`` directive in effect, - then ``sys.path`` will be set exactly according to it (no - directories added, the *dir* argument is ignored). - - The registration of the filter this way only persists for the life - of the request. To actually add the filter into the chain of input - filters for the current request ``request.add_input_filter()`` would be - used. - - -.. method:: request.register_output_filter(filter_name, filter[, dir]) - - Allows dynamic registration of mod_python output - filters. *filter_name* is a string which would then subsequently be - used to identify the filter. *filter* is a string containing the - name of the module and the filter function. Optional *dir* is a - string containing the name of the directory to be added to the - pythonpath. If there is a ``PythonPath`` directive in effect, then - ``sys.path`` will be set exactly according to it (no directories - added, the *dir* argument is ignored). - - The registration of the filter this way only persists for the life - of the request. To actually add the filter into the chain of output - filters for the current request :meth:`request.add_output_filter()` - would be used. - - -.. method:: request.sendfile(path[, offset, len]) - - Sends *len* bytes of file *path* directly to the client, starting - at offset *offset* using the server's internal API. *offset* - defaults to 0, and *len* defaults to -1 (send the entire file). - - Returns the number of bytes sent, or raises an IOError exception on - failure. - - This function provides the most efficient way to send a file to the - client. - - -.. method:: request.set_etag() - - Sets the outgoing ``'ETag'`` header. - - -.. method:: request.set_last_modified() - - Sets the outgoing ``Last-Modified`` header based on value of - ``mtime`` attribute. - - -.. method:: request.ssl_var_lookup(var_name) - - Looks up the value of the named SSL variable. This method queries - the mod_ssl Apache module directly, and may therefore be used in - early request phases (unlike using the :attr:`request.subprocess_env` - member. - - If the mod_ssl Apache module is not loaded or the variable is not - found then ``None`` is returned. - - If you just want to know if a SSL or TLS connection is being used, - you may consider calling the ``is_https`` method instead. - - It is unfortunately not possible to get a list of all available - variables with the current mod_ssl implementation, so you must know - the name of the variable you want. Some of the potentially useful - ssl variables are listed below. For a complete list of variables - and a description of their values see the mod_ssl documentation.:: - - - SSL_CIPHER - SSL_CLIENT_CERT - SSL_CLIENT_VERIFY - SSL_PROTOCOL - SSL_SESSION_ID - - .. note:: - - Not all SSL variables are defined or have useful values in every - request phase. Also use caution when relying on these values - for security purposes, as SSL or TLS protocol parameters can - often be renegotiated at any time during a request. - - -.. method:: request.update_mtime(dependency_mtime) - - If *ependency_mtime* is later than the value in the ``mtime`` - attribute, sets the attribute to the new value. - - -.. method:: request.write(string[, flush=1]) - - Writes *string* directly to the client, then flushes the buffer, - unless flush is 0. Unicode strings are encoded using ``utf-8`` - encoding. - - -.. method:: request.flush() - - Flushes the output buffer. - - -.. method:: request.set_content_length(len) - - Sets the value of :attr:`request.clength` and the ``'Content-Length'`` - header to len. Note that after the headers have been sent out - (which happens just before the first byte of the body is written, - i.e. first call to :meth:`request.write`), calling the method is - meaningless. - -.. _pyapi-mprequest-mem: - -Request Members -^^^^^^^^^^^^^^^ - -.. attribute:: request.connection - - A ``connection`` object associated with this request. See - :ref:`pyapi-mpconn` Object for more details. - *(Read-Only)* - - -.. attribute:: request.server - - A server object associated with this request. See - :ref:`pyapi-mpserver` for more details. - *(Read-Only)* - - -.. attribute:: request.next - - If this is an internal redirect, the request object we redirect to. - *(Read-Only)* - - -.. attribute:: request.prev - - If this is an internal redirect, the request object we redirect from. - *(Read-Only)* - - -.. attribute:: request.main - - If this is a sub-request, pointer to the main request. - *(Read-Only)* - - -.. attribute:: request.the_request - - String containing the first line of the request. - *(Read-Only)* - - -.. attribute:: request.assbackwards - - Indicates an HTTP/0.9 "simple" request. This means that the - response will contain no headers, only the body. Although this - exists for backwards compatibility with obsolescent browsers, some - people have figured out that setting assbackwards to 1 can be a - useful technique when including part of the response from an - internal redirect to avoid headers being sent. - - -.. attribute:: request.proxyreq - - A proxy request: one of :const:`apache.PROXYREQ_*` values. - - -.. attribute:: request.header_only - - A boolean value indicating HEAD request, as opposed to GET. - *(Read-Only)* - - -.. attribute:: request.protocol - - Protocol, as given by the client, or ``'HTTP/0.9'``. Same as CGI :envvar:`SERVER_PROTOCOL`. - *(Read-Only)* - - -.. attribute:: request.proto_num - - Integer. Number version of protocol; 1.1 = 1001 *(Read-Only)* - - -.. attribute:: request.hostname - - String. Host, as set by full URI or Host: header. *(Read-Only)* - - -.. attribute:: request.request_time - - A long integer. When request started. *(Read-Only)* - - -.. attribute:: request.status_line - - Status line. E.g. ``'200 OK'``. *(Read-Only)* - - -.. attribute:: request.status - - Status. One of :const:`apache.HTTP_*` values. - - -.. attribute:: request.method - - A string containing the method - ``'GET'``, ``'HEAD'``, ``'POST'``, etc. Same - as CGI :envvar:`REQUEST_METHOD`. *(Read-Only)* - - -.. attribute:: request.method_number - - Integer containing the method number. *(Read-Only)* - - -.. attribute:: request.allowed - - Integer. A bitvector of the allowed methods. Used to construct the - Allowed: header when responding with - :const:`HTTP_METHOD_NOT_ALLOWED` or - :const:`HTTP_NOT_IMPLEMENTED`. This field is for Apache's - internal use, to set the ``Allowed:`` methods use - :meth:`request.allow_methods` method, described in section - :ref:`pyapi-mprequest-meth`. *(Read-Only)* - - -.. attribute:: request.allowed_xmethods - - Tuple. Allowed extension methods. *(Read-Only)* - - -.. attribute:: request.allowed_methods - - Tuple. List of allowed methods. Used in relation with - :const:`METHOD_NOT_ALLOWED`. This member can be modified via - :meth:`request.allow_methods` described in section - :ref:`pyapi-mprequest-meth`. *(Read-Only)* - - -.. attribute:: request.sent_bodyct - - Integer. Byte count in stream is for body. (?) *(Read-Only)* - - -.. attribute:: request.bytes_sent - - Long integer. Number of bytes sent. *(Read-Only)* - - -.. attribute:: request.mtime - - Long integer. Time the resource was last modified. *(Read-Only)* - - -.. attribute:: request.chunked - - Boolean value indicating when sending chunked transfer-coding. - *(Read-Only)* - - -.. attribute:: request.range - - String. The ``Range:`` header. *(Read-Only)* - - -.. attribute:: request.clength - - Long integer. The "real" content length. *(Read-Only)* - - -.. attribute:: request.remaining - - Long integer. Bytes left to read. (Only makes sense inside a read - operation.) *(Read-Only)* - - -.. attribute:: request.read_length - - Long integer. Number of bytes read. *(Read-Only)* - - -.. attribute:: request.read_body - - Integer. How the request body should be read. *(Read-Only)* - - -.. attribute:: request.read_chunked - - Boolean. Read chunked transfer coding. *(Read-Only)* - - -.. attribute:: request.expecting_100 - - Boolean. Is client waiting for a 100 (:const:`HTTP_CONTINUE`) - response. *(Read-Only)* - - -.. attribute:: request.headers_in - - A :class:`table` object containing headers sent by the client. - - -.. attribute:: request.headers_out - - A :class:`table` object representing the headers to be sent to the - client. - - -.. attribute:: request.err_headers_out - - These headers get send with the error response, instead of - headers_out. - - -.. attribute:: request.subprocess_env - - A :class:`table` object containing environment information - typically usable for CGI. You may have to call - :meth:`request.add_common_vars` and :meth:`request.add_cgi_vars` - first to fill in the information you need. - - -.. attribute:: request.notes - - A :class:`table` object that could be used to store miscellaneous - general purpose info that lives for as long as the request - lives. If you need to pass data between handlers, it's better to - simply add members to the request object than to use - :attr:`request.notes`. - - -.. attribute:: request.phase - - The phase currently being being processed, - e.g. ``'PythonHandler'``. *(Read-Only)* - - -.. attribute:: request.interpreter - - The name of the subinterpreter under which we're running. - *(Read-Only)* - - -.. attribute:: request.content_type - - String. The content type. Mod_python maintains an internal flag - (:attr:`request._content_type_set`) to keep track of whether - :attr:`request.content_type` was set manually from within - Python. The publisher handler uses this flag in the following way: - when :attr:`request.content_type` isn't explicitly set, it attempts - to guess the content type by examining the first few bytes of the - output. - - -.. attribute:: request.content_languages - - Tuple. List of strings representing the content languages. - - -.. attribute:: request.handler - - The symbolic name of the content handler (as in module, not - mod_python handler) that will service the request during the - response phase. When the SetHandler/AddHandler directives are used - to trigger mod_python, this will be set to ``'mod_python'`` by - mod_mime. A mod_python handler executing prior to the response - phase may also set this to ``'mod_python'`` along with calling - :meth:`request.add_handler` to register a mod_python handler for - the response phase:: - - def typehandler(req): - if os.path.splitext(req.filename)[1] == ".py": - req.handler = "mod_python" - req.add_handler("PythonHandler", "mod_python.publisher") - return apache.OK - return apache.DECLINED - - -.. attribute:: request.content_encoding - - String. Content encoding. *(Read-Only)* - - -.. attribute:: request.vlist_validator - - Integer. Variant list validator (if negotiated). *(Read-Only)* - - -.. attribute:: request.user - - If an authentication check is made, this will hold the user - name. Same as CGI :envvar:`REMOTE_USER`. - - On Python 3 the string is decoded using Latin1. (Different browsers - use different encodings for non-Latin1 characters for the basic - authentication string making a solution that fits all impossible, - you can always decode the header manually.) - - .. note:: - - :meth:`request.get_basic_auth_pw` must be called prior to using this value. - - -.. attribute:: request.ap_auth_type - - Authentication type. Same as CGI :envvar:`AUTH_TYPE`. - - -.. attribute:: request.no_cache - - Boolean. This response cannot be cached. - - -.. attribute:: request.no_local_copy - - Boolean. No local copy exists. - - -.. attribute:: request.unparsed_uri - - The URI without any parsing performed. *(Read-Only)* - - -.. attribute:: request.uri - - The path portion of the URI. - - -.. attribute:: request.filename - - String. File name being requested. - - -.. attribute:: request.canonical_filename - - String. The true filename (:attr:`request.filename` is - canonicalized if they don't match). - - -.. attribute:: request.path_info - - String. What follows after the file name, but is before query args, - if anything. Same as CGI :envvar:`PATH_INFO`. - - -.. attribute:: request.args - - String. Same as CGI :envvar:`QUERY_ARGS`. - - -.. attribute:: request.finfo - - A file information object with type ``mp_finfo``, analogous to the - result of the POSIX stat function, describing the file pointed to - by the URI. The object provides the attributes ``fname``, - ``filetype``, ``valid``, ``protection``, ``user``, ``group``, ``size``, - ``inode``, ``device``, ``nlink``, ``atime``, ``mtime``, ``ctime`` and - ``name``. - - The attribute may be assigned to using the result of - :func:`apache.stat`. For example:: - - if req.finfo.filetype == apache.APR_DIR: - req.filename = posixpath.join(req.filename, 'index.html') - req.finfo = apache.stat(req.filename, apache.APR_FINFO_MIN) - - For backward compatibility, the object can also be accessed as if - it were a tuple. The ``apache`` module defines a set of - :const:`FINFO_*` constants that should be used to access elements - of this tuple.:: - - user = req.finfo[apache.FINFO_USER] - - -.. attribute:: request.parsed_uri - - Tuple. The URI broken down into pieces. ``(scheme, hostinfo, user, password, hostname, port, path, query, fragment)``. - The :mod:`apache` module defines a set of :const:`URI_*` constants that - should be used to access elements of this tuple. Example:: - - fname = req.parsed_uri[apache.URI_PATH] - - *(Read-Only)* - - -.. attribute:: request.used_path_info - - Flag to accept or reject path_info on current request. - - -.. attribute:: request.eos_sent - - Boolean. EOS bucket sent. *(Read-Only)* - - -.. attribute:: request.useragent_addr - - *Apache 2.4 only* - - The (address, port) tuple for the user agent. - - This attribute should reflect the address of the user agent and - not necessarily the other end of the TCP connection, for which - there is :attr:`connection.client_addr`. - *(Read-Only)* - - -.. attribute:: request.useragent_ip - - *Apache 2.4 only* - - String with the IP of the user agent. Same as CGI :envvar:`REMOTE_ADDR`. - - This attribute should reflect the address of the user agent and - not necessarily the other end of the TCP connection, for which - there is :attr:`connection.client_ip`. - *(Read-Only)* - - -.. _pyapi-mpconn: - -Connection Object (mp_conn) ---------------------------- - -.. index:: - singe: mp_conn - -The connection object is a Python mapping to the Apache -:c:type:`conn_rec` structure. - -.. _pyapi-mpconn-meth: - -Connection Methods -^^^^^^^^^^^^^^^^^^ - -.. method:: connection.log_error(message[, level]) - - An interface to the Apache ``ap_log_cerror`` function. *message* is - a string with the error message, *level* is one of the following - flags constants:: - - APLOG_EMERG - APLOG_ALERT - APLOG_CRIT - APLOG_ERR - APLOG_WARNING - APLOG_NOTICE - APLOG_INFO - APLOG_DEBUG - APLOG_NOERRNO - - If you need to write to log and do not have a reference to a connection or - request object, use the :func:`apache.log_error` function. - - -.. method:: connection.read([length]) - - Reads at most *length* bytes from the client. The read blocks - indefinitely until there is at least one byte to read. If length is - -1, keep reading until the socket is closed from the other end - (This is known as ``EXHAUSTIVE`` mode in the http server code). - - This method should only be used inside *Connection Handlers*. - - .. note:: - - The behavior of this method has changed since version 3.0.3. In - 3.0.3 and prior, this method would block until *length* bytes - was read. - - -.. method:: connection.readline([length]) - - Reads a line from the connection or up to *length* bytes. - - This method should only be used inside *Connection Handlers*. - - -.. method:: connection.write(string) - - Writes *string* to the client. - - This method should only be used inside *Connection Handlers*. - - -.. _pyapi-mpconn-mem: - -Connection Members -^^^^^^^^^^^^^^^^^^ - -.. attribute:: connection.base_server - - A ``server`` object for the physical vhost that this connection came - in through. *(Read-Only)* - - -.. attribute:: connection.local_addr - - The (address, port) tuple for the server. *(Read-Only)* - - -.. attribute:: connection.remote_addr - - *Deprecated in Apache 2.4, use client_addr. (Aliased to client_addr for backward compatibility)* - - The (address, port) tuple for the client. *(Read-Only)* - - -.. attribute:: connection.client_addr - - *Apache 2.4 only* - - The (address, port) tuple for the client. - - This attribute reflects the other end of the TCP connection, which - may not always be the address of the user agent. A more accurate - source of the user agent address is :attr:`request.useragent_addr`. - *(Read-Only)* - - -.. attribute:: connection.remote_ip - - *Deprecated in Apache 2.4, use client_ip. (Aliased to client_ip for backward compatibility)* - - String with the IP of the client. In Apache 2.2 same as CGI :envvar:`REMOTE_ADDR`. - *(Read-Only)* - - -.. attribute:: connection.client_ip - - *Apache 2.4 only* - - String with the IP of the client. - - This attribute reflects the other end of the TCP connection, which - may not always be the address of the user agent. A more accurate - source of the user agent address is :attr:`request.useragent_ip`. - - *(Read-Only)* - - -.. attribute:: connection.remote_host - - String. The DNS name of the remote client. None if DNS has not been - checked, ``''`` (empty string) if no name found. Same as CGI - :envvar:`REMOTE_HOST`. *(Read-Only)* - - -.. attribute:: connection.remote_logname - - Remote name if using :rfc:`1413` (ident). Same as CGI - :envvar:`REMOTE_IDENT`. *(Read-Only)* - - -.. attribute:: connection.aborted - - Boolean. True is the connection is aborted. *(Read-Only)* - - -.. attribute:: connection.keepalive - - Integer. 1 means the connection will be kept for the next request, - 0 means "undecided", -1 means "fatal error". *(Read-Only)* - - -.. attribute:: connection.double_reverse - - Integer. 1 means double reverse DNS lookup has been performed, 0 - means not yet, -1 means yes and it failed. *(Read-Only)* - - -.. attribute:: connection.keepalives - - The number of times this connection has been used. (?) - *(Read-Only)* - - -.. attribute:: connection.local_ip - - String with the IP of the server. *(Read-Only)* - - -.. attribute:: connection.local_host - - DNS name of the server. *(Read-Only)* - - -.. attribute:: connection.id - - Long. A unique connection id. *(Read-Only)* - - -.. attribute:: connection.notes - - A :class:`table` object containing miscellaneous general purpose - info that lives for as long as the connection lives. - - -.. _pyapi-mpfilt: - -Filter Object (mp_filter) -------------------------- - -.. index:: - singe: mp_filter - -A filter object is passed to mod_python input and output filters. It -is used to obtain filter information, as well as get and pass -information to adjacent filters in the filter stack. - -.. _pyapi-mpfilt-meth: - -Filter Methods -^^^^^^^^^^^^^^ - -.. method:: filter.pass_on() - - Passes all data through the filter without any processing. - - -.. method:: filter.read([length]) - - Reads at most *len* bytes from the next filter, returning a - string with the data read or None if End Of Stream (EOS) has been - reached. A filter *must* be closed once the EOS has been - encountered. - - If the *length* argument is negative or omitted, reads all data - currently available. - - -.. method:: filter.readline([length]) - - Reads a line from the next filter or up to *length* bytes. - - -.. method:: filter.write(string) - - Writes *string* to the next filter. - - -.. method:: filte.flush() - - Flushes the output by sending a FLUSH bucket. - - -.. method:: filter.close() - - Closes the filter and sends an EOS bucket. Any further IO - operations on this filter will throw an exception. - - -.. method:: filter.disable() - - Tells mod_python to ignore the provided handler and just pass the - data on. Used internally by mod_python to print traceback from - exceptions encountered in filter handlers to avoid an infinite - loop. - - -.. _pyapi-mpfilt-mem: - -Filter Members -^^^^^^^^^^^^^^ - -.. attribute:: filter.closed - - A boolean value indicating whether a filter is closed. - *(Read-Only)* - - -.. attribute:: filter.name - - String. The name under which this filter is registered. - *(Read-Only)* - - -.. attribute:: filter.req - - A reference to the request object. *(Read-Only)* - - -.. attribute:: filter.is_input - - Boolean. True if this is an input filter. *(Read-Only)* - - -.. attribute:: filter.handler - - String. The name of the Python handler for this filter as specified - in the configuration. *(Read-Only)* - - -.. _pyapi-mpserver: - -Server Object (mp_server) -^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. index:: - single: mp_server - - -The request object is a Python mapping to the Apache -``request_rec`` structure. The server structure describes the -server (possibly virtual server) serving the request. - -.. _pyapi-mpsrv-meth: - -Server Methods -^^^^^^^^^^^^^^ - -.. method:: server.get_config() - - Similar to :meth:`request.get_config()`, but returns a table object - holding only the mod_python configuration defined at global scope - within the Apache configuration. That is, outside of the context of - any VirtualHost, Location, Directory or Files directives. - - -.. method:: server.get_options() - - Similar to :meth:`request.get_options()`, but returns a table - object holding only the mod_python options defined at global scope - within the Apache configuration. That is, outside of the context of - any VirtualHost, Location, Directory or Files directives. - - -.. method:: server.log_error(message[level]) - - An interface to the Apache ``ap_log_error`` function. *message* is - a string with the error message, *level* is one of the following - flags constants:: - - APLOG_EMERG - APLOG_ALERT - APLOG_CRIT - APLOG_ERR - APLOG_WARNING - APLOG_NOTICE - APLOG_INFO - APLOG_DEBUG - APLOG_NOERRNO - - If you need to write to log and do not have a reference to a server or - request object, use the :func:`apache.log_error` function. - - -.. method:: server.register_cleanup(request, callable[, data]) - - Registers a cleanup. Very similar to :meth:`req.register_cleanup`, - except this cleanup will be executed at child termination - time. This function requires the request object be supplied to - infer the interpreter name. If you don't have any request object - at hand, then you must use the :func:`apache.register_cleanup` - variant. - - .. note:: - - *Warning:* do not pass directly or indirectly a request object in - the data parameter. Since the callable will be called at server - shutdown time, the request object won't exist anymore and any - manipulation of it in the callable will give undefined behaviour. - -.. _pyapi-mpsrv-mem: - -Server Members -^^^^^^^^^^^^^^ - -.. attribute:: server.defn_name - - String. The name of the configuration file where the server - definition was found. *(Read-Only)* - - -.. attribute:: server.defn_line_number - - Integer. Line number in the config file where the server definition - is found. *(Read-Only)* - - -.. attribute:: server.server_admin - - Value of the ``ServerAdmin`` directive. *(Read-Only)* - - -.. attribute:: server.server_hostname - - Value of the ``ServerName`` directive. Same as CGI - :envvar:`SERVER_NAME`. *(Read-Only)* - - -.. attribute:: server.names - - Tuple. List of normal server names specified in the ``ServerAlias`` - directive. This list does not include wildcarded names, which are - listed separately in ``wild_names``. *(Read-Only)* - - -.. attribute:: server.wild_names - - Tuple. List of wildcarded server names specified in the ``ServerAlias`` - directive. *(Read-Only)* - - -.. attribute:: server.port - - Integer. TCP/IP port number. Same as CGI :envvar:`SERVER_PORT`. - *This member appears to be 0 on Apache 2.0, look at - req.connection.local_addr instead* *(Read-Only)* - - -.. attribute:: server.error_fname - - The name of the error log file for this server, if any. - *(Read-Only)* - - -.. attribute:: server.loglevel - - Integer. Logging level. *(Read-Only)* - - -.. attribute:: server.is_virtual - - Boolean. True if this is a virtual server. *(Read-Only)* - - -.. attribute:: server.timeout - - Integer. Value of the ``Timeout`` directive. *(Read-Only)* - - -.. attribute:: server.keep_alive_timeout - - Integer. Keepalive timeout. *(Read-Only)* - - -.. attribute:: server.keep_alive_max - - Maximum number of requests per keepalive. *(Read-Only)* - - -.. attribute:: server.keep_alive - - Use persistent connections? *(Read-Only)* - - -.. attribute:: server.path - - String. Path for ``ServerPath`` *(Read-Only)* - - -.. attribute:: server.pathlen - - Integer. Path length. *(Read-Only)* - - -.. attribute:: server.limit_req_line - - Integer. Limit on size of the HTTP request line. *(Read-Only)* - - -.. attribute:: server.limit_req_fieldsize - - Integer. Limit on size of any request header field. *(Read-Only)* - - -.. attribute:: server.limit_req_fields - - Integer. Limit on number of request header fields. *(Read-Only)* - - -.. _pyapi-util: - -:mod:`util` -- Miscellaneous Utilities -====================================== - -.. module:: util - :synopsis: Miscellaneous Utilities. -.. moduleauthor:: Gregory Trubetskoy grisha@modpython.org - -The :mod:`util` module provides a number of utilities handy to a web -application developer similar to those in the standard library -:mod:`cgi` module. The implementations in the :mod:`util` module are -much more efficient because they call directly into Apache API's as -opposed to using CGI which relies on the environment to pass -information. - -The recommended way of using this module is:: - - from mod_python import util - - -.. seealso:: - - :rfc:`3875` - for detailed information on the CGI specification - -.. _pyapi-util-fstor: - - -FieldStorage class ------------------- - -Access to form data is provided via the :class:`FieldStorage` -class. This class is similar to the standard library module -``cgi.FieldStorage`` - -.. class:: FieldStorage(req[, keep_blank_values[, strict_parsing[, file_callback[, field_callback]]]]) - - This class provides uniform access to HTML form data submitted by - the client. *req* is an instance of the mod_python - :class:`request` object. - - The optional argument *keep_blank_values* is a flag indicating - whether blank values in URL encoded form data should be treated as - blank strings. The default is false, which means that blank values - are ignored as if they were not included. - - The optional argument *strict_parsing* is not yet implemented. - - The optional argument *file_callback* allows the application to - override both file creation/deletion semantics and location. See - :ref:`pyapi-util-fstor-examples` for - additional information. *New in version 3.2* - - The optional argument *field_callback* allows the application to - override both the creation/deletion semantics and behavior. *New - in version 3.2* - - During initialization, :class:`FieldStorage` class reads all of the - data provided by the client. Since all data provided by the client - is consumed at this point, there should be no more than one - :class:`FieldStorage` class instantiated per single request, nor - should you make any attempts to read client data before or after - instantiating a :class:`FieldStorage`. A suggested strategy for - dealing with this is that any handler should first check for the - existence of a ``form`` attribute within the request object. If - this exists, it should be taken to be an existing instance of the - :class:`FieldStorage` class and that should be used. If the - attribute does not exist and needs to be created, it should be - cached as the ``form`` attribute of the request object so later - handler code can use it. - - When the :class:`FieldStorage` class instance is created, the data - read from the client is then parsed into separate fields and - packaged in :class:`Field` objects, one per field. For HTML form - inputs of type ``file``, a temporary file is created that can later - be accessed via the :attr:`Field.file` attribute of a - :class:`Field` object. - - The :class:`FieldStorage` class has a mapping object interface, - i.e. it can be treated like a dictionary in most instances, but is - not strictly compatible as is it missing some methods provided by - dictionaries and some methods don't behave entirely like their - counterparts, especially when there is more than one value - associated with a form field. When used as a mapping, the keys are - form input names, and the returned dictionary value can be: - - * An instance of :class:`StringField`, containing the form input - value. This is only when there is a single value corresponding to - the input name. :class:`StringField` is a subclass of - :class:`str` which provides the additional - :attr:`StringField.value` attribute for compatibility with - standard library :mod:`cgi` module. - - * An instance of a :class:`Field` class, if the input is a file - upload. - - * A list of :class:`StringField` and/or :class:`Field` - objects. This is when multiple values exist, such as for a - ``<select>`` HTML form element. - - - .. note:: - - Unlike the standard library :mod:`cgi` module - :class:`FieldStorage` class, a :class:`Field` object is returned - *only* when it is a file upload. In all other cases the return - is an instance of :class:`StringField`. This means that you do - not need to use the :attr:`StringFile.value` attribute to access - values of fields in most cases. - - - In addition to standard mapping object methods, - :class:`FieldStorage` objects have the following attributes: - - .. attribute:: list - - This is a list of :class:`Field` objects, one for each - input. Multiple inputs with the same name will have multiple - elements in this list. - - .. _pyapi-util-fstor-meth: - -:class:`FieldStorage` methods -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - .. method:: add_field(name, value) - - Adds an additional form field with *name* and *value*. If a - form field already exists with *name*, the *value* will be added - to the list of existing values for the form field. This method - should be used for adding additional fields in preference to - adding new fields direct to the list of fields. - - If the value associated with a field should be replaced when it - already exists, rather than an additional value being associated - with the field, the dictionary like subscript operator should be - used to set the value, or the existing field deleted altogether - first using the ``del`` operator. - - - .. method:: clear() - - Removes all form fields. Individual form fields can be deleted - using the ``del`` operator. - - - .. method:: get(name, default) - - If there is only one value associated with form field *name*, - that single value will be returned. If there are multiple values, - a list is returned holding all values. If no such form field or - value exists then the method returns the value specified by the - parameter *default*. A subscript operator is also available - which yields the same result except that an exception will be - raised where the form field *name* does not exist. - - - .. method:: getfirst(name[, default]) - - Always returns only one value associated with form field - *name*. If no such form field or value exists then the method - returns the value specified by the optional parameter - *default*. This parameter defaults to ``None`` if not specified. - - - .. method:: getlist(name) - - This method always returns a list of values associated with form - field *name*. The method returns an empty list if no such form - field or value exists for *name*. It returns a list consisting - of one item if only one such value exists. - - - .. method:: has_key(name) - - Returns ``True`` if *name* is a valid form field. The ``in`` - operator is also supported and will call this method. - - - .. method:: items() - - Returns a list consisting of tuples for each combination of form - field name and value. - - - .. method:: keys() - - This method returns the names of the form fields. The ``len`` - operator is also supported and will return the number of names - which would be returned by this method. - - -.. _pyapi-util-fstor-examples: - -FieldStorage Examples ---------------------- - - The following examples demonstrate how to use the *file_callback* - parameter of the :class:`FieldStorage` constructor to control file - object creation. The :class:`Storage` classes created in both - examples derive from FileType, thereby providing extended file - functionality. - - These examples are provided for demonstration purposes only. The - issue of temporary file location and security must be considered - when providing such overrides with mod_python in production use. - - -Simple file control using class constructor -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - This example uses the :class:`FieldStorage` class constructor to - create the file object, allowing simple control. It is not - advisable to add class variables to this if serving multiple - sites from apache. In that case use the factory method instead:: - - class Storage(file): - - def __init__(self, advisory_filename): - self.advisory_filename = advisory_filename - self.delete_on_close = True - self.already_deleted = False - self.real_filename = '/someTempDir/thingy-unique-thingy' - super(Storage, self).__init__(self.real_filename, 'w+b') - - def close(self): - if self.already_deleted: - return - super(Storage, self).close() - if self.delete_on_close: - self.already_deleted = True - os.remove(self.real_filename) - - request_data = util.FieldStorage(request, keep_blank_values=True, file_callback=Storage) - - -Advanced file control using object factory -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - Using a object factory can provide greater control over the - constructor parameters:: - - import os - - class Storage(file): - - def __init__(self, directory, advisory_filename): - self.advisory_filename = advisory_filename - self.delete_on_close = True - self.already_deleted = False - self.real_filename = directory + '/thingy-unique-thingy' - super(Storage, self).__init__(self.real_filename, 'w+b') - - def close(self): - if self.already_deleted: - return - super(Storage, self).close() - if self.delete_on_close: - self.already_deleted = True - os.remove(self.real_filename) - - class StorageFactory: - - def __init__(self, directory): - self.dir = directory - - def create(self, advisory_filename): - return Storage(self.dir, advisory_filename) - - file_factory = StorageFactory(someDirectory) - # [...sometime later...] - request_data = util.FieldStorage(request, keep_blank_values=True, - file_callback=file_factory.create) - -.. _pyapi-util-fstor-fld: - -Field class ------------ - -.. class:: Field() - - This class is used internally by :class:`FieldStorage` and is not - meant to be instantiated by the user. Each instance of a - :class:`Field` class represents an HTML Form input. - - :class:`Field` instances have the following attributes: - - .. attribute:: name - - The input name. - - .. attribute:: value - - The input value. This attribute can be used to read data from a - file upload as well, but one has to exercise caution when - dealing with large files since when accessed via :attr:`value`, - the whole file is read into memory. - - .. attribute:: file - - This is a file-like object. For file uploads it points to a - :class:`TemporaryFile` instance. (For more information see the - TemporaryFile class in the standard python `tempfile module - <http://docs.python.org/lib/module-tempfile.html>`_. - - For simple values, it is a :class:`StringIO` object, so you can read - simple string values via this attribute instead of using the :attr:`value` - attribute as well. - - .. attribute:: filename - - The name of the file as provided by the client. - - .. attribute:: type - - The content-type for this input as provided by the client. - - .. attribute:: type_options - - This is what follows the actual content type in the ``content-type`` - header provided by the client, if anything. This is a dictionary. - - .. attribute:: disposition - - The value of the first part of the ``content-disposition`` header. - - .. attribute:: disposition_options - - The second part (if any) of the ``content-disposition`` header in - the form of a dictionary. - - .. seealso:: - - :rfc:`1867` - Form-based File Upload in HTML for a description of form-based file uploads - - -.. _pyapi-util-funcs: - -Other functions ---------------- - -.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing]]) - - This function is functionally equivalent to the standard library - :func:`cgi.parse_qs`, except that it is written in C and is - much faster. - - Parse a query string given as a string argument (data of type - ``application/x-www-form-urlencoded``). Data are returned as a - dictionary. The dictionary keys are the unique query variable - names and the values are lists of values for each name. - - The optional argument *keep_blank_values* is a flag indicating - whether blank values in URL encoded queries should be treated as - blank strings. A true value indicates that blanks should be - retained as blank strings. The default false value indicates that - blank values are to be ignored and treated as if they were not - included. - - .. note:: - - The *strict_parsing* argument is not yet implemented. - - -.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing]]) - - This function is functionally equivalent to the standard library - :func:`cgi.parse_qsl`, except that it is written in C and is much - faster. - - Parse a query string given as a string argument (data of type - ``application/x-www-form-urlencoded``). Data are returned as a - list of name, value pairs. - - The optional argument *keep_blank_values* is a flag indicating - whether blank values in URL encoded queries should be treated as - blank strings. A true value indicates that blanks should be - retained as blank strings. The default false value indicates that - blank values are to be ignored and treated as if they were not - included. - - .. note:: - - The *strict_parsing* argument is not yet implemented. - - -.. function:: redirect(req, location[, permanent=0[, text=None]]) - - This is a convenience function to redirect the browser to another - location. When *permanent* is true, :const:`MOVED_PERMANENTLY` - status is sent to the client, otherwise it is - :const:`MOVED_TEMPORARILY`. A short text is sent to the browser - informing that the document has moved (for those rare browsers that - do not support redirection); this text can be overridden by - supplying a *text* string. - - If this function is called after the headers have already been sent, - an :exc:`IOError` is raised. - - This function raises :exc:`apache.SERVER_RETURN` exception with a - value of :const:`apache.DONE` to ensuring that any later phases or - stacked handlers do not run. If you do not want this, you can wrap - the call to :func:`redirect` in a try/except block catching the - :exc:`apache.SERVER_RETURN`. - - -.. _pyapi-cookie: - -:mod:`Cookie` -- HTTP State Management -====================================== - -.. module:: Cookie - :synopsis: HTTP State Management -.. moduleauthor:: Gregory Trubetskoy grisha@modpython.org - -The :mod:`Cookie` module provides convenient ways for creating, -parsing, sending and receiving HTTP Cookies, as defined in the -specification published by Netscape. - -.. note:: - - Even though there are official IETF RFC's describing HTTP State - Management Mechanism using cookies, the de facto standard supported - by most browsers is the original Netscape specification. - Furthermore, true compliance with IETF standards is actually - incompatible with many popular browsers, even those that claim to - be RFC-compliant. Therefore, this module supports the current - common practice, and is not fully RFC compliant. - - More specifically, the biggest difference between Netscape and RFC - cookies is that RFC cookies are sent from the browser to the server - along with their attributes (like Path or Domain). The - :mod:`Cookie` module ignore those incoming attributes, so all - incoming cookies end up as Netscape-style cookies, without any of - their attributes defined. - - -.. seealso:: - - `Persistent Client State - HTTP Cookies <http://web.archive.org/web/20070202195439/http://wp.netscape.com/newsref/std/cookie_spec.html>`_ - for the original Netscape specification. - - :rfc:`2109` - HTTP State Management Mechanism for the first RFC on Cookies. - - :rfc:`2694` - Use of HTTP State Management for guidelines on using Cookies. - - :rfc:`2965` - HTTP State Management Mechanism for the latest IETF standard. - - `HTTP Cookies: Standards, Privacy, and Politics <http://arxiv.org/abs/cs.SE/0105018>`_ - by David M. Kristol for an excellent overview of the issues surrounding standardization of Cookies. - - -.. _pyapi-cookie-classes: - - -Classes -------- - -.. class:: Cookie(name, value[, attributes]) - - This class is used to construct a single cookie named *name* and - having *value* as the value. Additionally, any of the attributes - defined in the Netscape specification and RFC2109 can by supplied - as keyword arguments. - - The attributes of the class represent cookie attributes, and their - string representations become part of the string representation of - the cookie. The :class:`Cookie` class restricts attribute names to - only valid values, specifically, only the following attributes are - allowed: ``name, value, version, path, domain, secure, comment, expires, max_age, commentURL, discard, port, httponly, __data__``. - - The ``__data__`` attribute is a general-purpose dictionary that can - be used for storing arbitrary values, when necessary (This is - useful when subclassing :class:`Cookie`). - - The :attr:`expires` attribute is a property whose value is checked - upon setting to be in format ``'Wdy, DD-Mon-YYYY HH:MM:SS GMT'`` - (as dictated per Netscape cookie specification), or a numeric value - representing time in seconds since beginning of epoch (which will - be automatically correctly converted to GMT time string). An - invalid ``expires`` value will raise :exc:`ValueError`. - - When converted to a string, a :class:`Cookie` will be in correct - format usable as value in a ``'Cookie'`` or ``'Set-Cookie'`` - header. - - .. note:: - - Unlike the Python Standard Library Cookie classes, this class - represents a single cookie (referred to as :dfn:`Morsel` in - Python Standard Library). - - - .. method:: Cookie.parse(string) - - This is a class method that can be used to create a - :class:`Cookie` instance from a cookie string *string* as - passed in a header value. During parsing, attribute names are - converted to lower case. - - Because this is a class method, it must be called explicitly - specifying the class. - - This method returns a dictionary of :class:`Cookie` instances, - not a single :class:`Cookie` instance. - - Here is an example of getting a single :class:`Cookie` instance:: - - mycookies = Cookie.parse("spam=eggs; expires=Sat, 14-Jun-2003 02:42:36 GMT") - spamcookie = mycookies["spam"] - - .. note:: - - Because this method uses a dictionary, it is not possible to - have duplicate cookies. If you would like to have more than - one value in a single cookie, consider using a - :class:`MarshalCookie`. - - -.. class:: SignedCookie(name, value, secret[, attributes]) - - This is a subclass of :class:`Cookie`. This class creates cookies - whose name and value are automatically signed using HMAC (md5) with - a provided secret *secret*, which must be a non-empty string. - - .. method:: SignedCookie.parse(string, secret) - - This method acts the same way as :class:`Cookie.parse()`, but - also verifies that the cookie is correctly signed. If the - signature cannot be verified, the object returned will be of - class :class:`Cookie`:: - - .. note:: - - Always check the types of objects returned by - :meth:SignedCookie.parse(). If it is an instance of - :class:`Cookie` (as opposed to :class:`SignedCookie`), the - signature verification has failed:: - - # assume spam is supposed to be a signed cookie - if type(spam) is not Cookie.SignedCookie: - # do something that indicates cookie isn't signed correctly - -.. class:: MarshalCookie(name, value, secret[, attributes]) - - This is a subclass of :class:`SignedCookie`. It allows for *value* - to be any marshallable objects. Core Python types such as string, - integer, list, etc. are all marshallable object. For a complete - list see `marchal <http://www.python.org/doc/current/lib/module-marshal.html>`_ - module documentation. - - When parsing, the signature is checked first, so incorrectly signed - cookies will not be unmarshalled. - -.. _pyapi-cookie-func: - -Functions -^^^^^^^^^ - -.. function:: add_cookie(req, cookie[, value, attributes]) - - This is a convenience function for setting a cookie in request - headers. *req* is a mod_python :class:`Request` object. If - *cookie* is an instance of :class:`Cookie` (or subclass thereof), - then the cookie is set, otherwise, *cookie* must be a string, in - which case a :class:`Cookie` is constructed using *cookie* as - name, *value* as the value, along with any valid :class:`Cookie` - attributes specified as keyword arguments. - - This function will also set ``'Cache-Control: no-cache="set-cookie"'`` - header to inform caches that the cookie value should not be cached. - - Here is one way to use this function:: - - c = Cookie.Cookie('spam', 'eggs', expires=time.time()+300) - Cookie.add_cookie(req, c) - - Here is another: - - Cookie.add_cookie(req, 'spam', 'eggs', expires=time.time()+300) - -.. function:: get_cookies(req[, Class[, data]]) - - This is a convenience function for retrieving cookies from incoming - headers. *req* is a mod_python :class:`Request` object. *Class* - is a class whose :meth:`parse` method will be used to parse the - cookies, it defaults to ``Cookie``. *data* can be any number of - keyword arguments which, will be passed to :meth:`parse` (This - is useful for :class:`signedCookie` and :class:`MarshalCookie` - which require ``secret`` as an additional argument to - :meth:`parse`). The set of cookies found is returned as a - dictionary. - -.. function:: get_cookie(req, name [, Class[, data]]) - - This is a convenience function for retrieving a single named cookie - from incoming headers. *req* is a mod_python :class:`Request` - object. *name* is the name of the cookie. *Class* is a class - whose :meth:`parse()` method will be used to parse the cookies, it - defaults to ``Cookie``. *Data* can be any number of keyword - arguments which, will be passed to :meth:`parse` (This is useful - for :class:`signedCookie` and :class:`MarshalCookie` which require - ``secret`` as an additional argument to :meth:`parse`). The cookie - if found is returned, otherwise ``None`` is returned. - -.. _pyapi-cookie-example: - -Examples --------- - -This example sets a simple cookie which expires in 300 seconds:: - - from mod_python import Cookie, apache - import time - - def handler(req): - - cookie = Cookie.Cookie('eggs', 'spam') - cookie.expires = time.time() + 300 - Cookie.add_cookie(req, cookie) - - req.write('This response contains a cookie!\n') - return apache.OK - - -This example checks for incoming marshal cookie and displays it to the -client. If no incoming cookie is present a new marshal cookie is set. -This example uses ``'secret007'`` as the secret for HMAC signature:: - - from mod_python import apache, Cookie - - def handler(req): - - cookies = Cookie.get_cookies(req, Cookie.MarshalCookie, - secret='secret007') - if cookies.has_key('spam'): - spamcookie = cookies['spam'] - - req.write('Great, a spam cookie was found: %s\n' \ - % str(spamcookie)) - if type(spamcookie) is Cookie.MarshalCookie: - req.write('Here is what it looks like decoded: %s=%s\n' - % (spamcookie.name, spamcookie.value)) - else: - req.write('WARNING: The cookie found is not a \ - MarshalCookie, it may have been tapered with!') - - else: - - # MarshaCookie allows value to be any marshallable object - value = {'egg_count': 32, 'color': 'white'} - Cookie.add_cookie(req, Cookie.MarshalCookie('spam', value, \ - 'secret007')) - req.write('Spam cookie not found, but we just set one!\n') - - return apache.OK - -.. _pyapi-sess: - -:mod:`Session` -- Session Management -==================================== - -.. module:: Session - :synopsis: Session Management -.. moduleauthor:: Gregory Trubetskoy grisha@modpython.org - -The :mod:`Session` module provides objects for maintaining persistent -sessions across requests. - -The module contains a :class:`BaseSession` class, which is not meant -to be used directly (it provides no means of storing a session), -:class:`DbmSession` class, which uses a dbm to store sessions, and -:class:`FileSession` class, which uses individual files to store -sessions. - -The :class:`BaseSession` class also provides session locking, both -across processes and threads. For locking it uses APR global_mutexes -(a number of them is pre-created at startup) The mutex number is -computed by using modulus of the session id :func:`hash()`. (Therefore -it's possible that different session id's will have the same hash, but -the only implication is that those two sessions cannot be locked at -the same time resulting in a slight delay.) - -.. _pyapi-sess-classes: - -Classes -------- - -.. function:: Session(req[, sid[, secret[, timeout[, lock]]]]) - - :func:`Session()` takes the same arguments as :class:`BaseSession`. - - This function returns a instance of the default session class. The - session class to be used can be specified using ``PythonOption mod_python.session.session_type value``, - where *value* is one of - :class:`DbmSession`, :class:`MemorySession` or - :class:`FileSession`. Specifying custom session classes using - ``PythonOption`` session is not yet supported. - - If session type option is not found, the function queries the MPM - and based on that returns either a new instance of - :class:`DbmSession` or - :class:`MemorySession`. :class:`MemorySession` will be used if the - MPM is threaded and not forked (such is the case on Windows), or if - it threaded, forked, but only one process is allowed (the worker - MPM can be configured to run this way). In all other cases - :class:`DbmSession` is used. - - Note that on Windows if you are using multiple Python interpreter - instances and you need sessions to be shared between applications - running within the context of the distinct Python interpreter - instances, you must specifically indicate that :class:`DbmSession` - should be used, as :class:`MemorySession` will only allow a session - to be valid within the context of the same Python interpreter - instance. - - Also note that the option name ``mod_python.session.session_type`` - only started to be used from mod_python 3.3 onwards. If you need to - retain compatibility with older versions of mod_python, you should - use the now obsolete ``session`` option instead. - - -.. class:: BaseSession(req[, sid[, secret[, timeout[, lock]]]]) - - This class is meant to be used as a base class for other classes - that implement a session storage mechanism. *req* is a required - reference to a mod_python request object. - - :class:`BaseSession` is a subclass of :class:`dict`. Data can be - stored and retrieved from the session by using it as a dictionary. - - *sid* is an optional session id; if provided, such a session must - already exist, otherwise it is ignored and a new session with a new - sid is created. If *sid* is not provided, the object will attempt - to look at cookies for session id. If a sid is found in cookies, - but it is not previously known or the session has expired, then a - new sid is created. Whether a session is "new" can be determined - by calling the :meth:`is_new()` method. - - Cookies generated by sessions will have a path attribute which is - calculated by comparing the server ``DocumentRoot`` and the - directory in which the ``PythonHandler`` directive currently in - effect was specified. E.g. if document root is :file:`/a/b/c` and - the directory ``PythonHandler`` was specified was :file:`/a/b/c/d/e`, - the path will be set to :file:`/d/e`. - - The deduction of the path in this way will only work though where - the ``Directory`` directive is used and the directory is actually - within the document root. If the ``Location`` directive is used or - the directory is outside of the document root, the path will be set - to :file:`/`. You can force a specific path by setting the - ``mod_python.session.application_path`` option - (``'PythonOption mod_python.session.application_path /my/path'`` in server - configuration). - - Note that prior to mod_python 3.3, the option was - ``ApplicationPath``. If your system needs to be compatible with - older versions of mod_python, you should continue to use the now - obsolete option name. - - The domain of a cookie is by default not set for a session and as - such the session is only valid for the host which generated it. In - order to have a session which spans across common sub domains, you - can specify the parent domain using the - ``mod_python.session.application_domain`` option - (``'PythonOption mod_python.session.application_domain mod_python.org'`` in server - configuration). - - When a *secret* is provided, :class:`BaseSession` will use - :class:`SignedCookie` when generating cookies thereby making the - session id almost impossible to fake. The default is to use plain - :class:`Cookie` (though even if not signed, the session id is - generated to be very difficult to guess). - - A session will timeout if it has not been accessed and a save - performed, within the *timeout* period. Upon a save occurring the - time of last access is updated and the period until the session - will timeout be reset. The default *timeout* period is 30 - minutes. An attempt to load an expired session will result in a - "new" session. - - The *lock* argument (defaults to 1) indicates whether locking - should be used. When locking is on, only one session object with a - particular session id can be instantiated at a time. - - A session is in "new" state when the session id was just generated, - as opposed to being passed in via cookies or the *sid* argument. - - .. method:: BaseSession.is_new() - - Returns 1 if this session is new. A session will also be "new" - after an attempt to instantiate an expired or non-existent - session. It is important to use this method to test whether an - attempt to instantiate a session has succeeded, e.g.:: - - - sess = Session(req) - if sess.is_new(): - # redirect to login - util.redirect(req, 'http://www.mysite.com/login') - - - .. method:: BaseSession.id() - - Returns the session id. - - - .. method:: BaseSession.created() - - Returns the session creation time in seconds since beginning of - epoch. - - .. method:: BaseSession.last_accessed() - - Returns last access time in seconds since beginning of epoch. - - - .. method:: BaseSession.timeout() - - Returns session timeout interval in seconds. - - - .. method:: BaseSession.set_timeout(secs) - - Set timeout to *secs*. - - - .. method:: BaseSession.invalidate() - - This method will remove the session from the persistent store - and also place a header in outgoing headers to invalidate the - session id cookie. - - - .. method:: BaseSession.load() - - Load the session values from storage. - - - .. method:: BaseSession.save() - - This method writes session values to storage. - - - .. method:: BaseSession.delete() - - Remove the session from storage. - - - .. method:: BaseSession.init_lock() - - This method initializes the session lock. There is no need to - ever call this method, it is intended for subclasses that wish - to use an alternative locking mechanism. - - - .. method:: BaseSession.lock() - - Locks this session. If the session is already locked by another - thread/process, wait until that lock is released. There is no - need to call this method if locking is handled automatically - (default). - - This method registeres a cleanup which always unlocks the session - at the end of the request processing. - - - .. method:: BaseSession.unlock() - - Unlocks this session. (Same as :meth:`lock` - when locking is - handled automatically (default), there is no need to call this - method). - - - .. method:: BaseSession.cleanup() - - This method is for subclasses to implement session storage - cleaning mechanism (i.e. deleting expired sessions, etc.). It - will be called at random, the chance of it being called is - controlled by :const:`CLEANUP_CHANCE` :mod:`Session` module - variable (default 1000). This means that cleanups will be - ordered at random and there is 1 in 1000 chance of it - happening. Subclasses implementing this method should not - perform the (potentially time consuming) cleanup operation in - this method, but should instead use - :meth:req.register_cleanup` to register a cleanup which will - be executed after the request has been processed. - - - -.. class:: DbmSession(req[, dbm[, sid[, secret[, dbmtype[, timeout[, lock]]]]]]) - - This class provides session storage using a dbm file. Generally, - dbm access is very fast, and most dbm implementations memory-map - files for faster access, which makes their performance nearly as - fast as direct shared memory access. - - *dbm* is the name of the dbm file (the file must be writable by the - httpd process). This file is not deleted when the server process is - stopped (a nice side benefit of this is that sessions can survive - server restarts). By default the session information is stored in a - dbmfile named :file:`mp_sess.dbm` and stored in a temporary - directory returned by ``tempfile.gettempdir()`` standard library - function. An alternative directory can be specified using - ``PythonOption mod_python.dbm_session.database_directory /path/to/directory``. - The path and filename can can be overridden by - setting ``PythonOption mod_python.dbm_session.database_filename filename``. - - Note that the above names for the ``PythonOption`` settings were - changed to these values in mod_python 3.3. If you need to retain - compatibility with older versions of mod_python, you should - continue to use the now obsolete ``session_directory`` and - ``session_dbm`` options. - - The implementation uses Python :mod:`anydbm` module, which will - default to :mod:`dbhash` on most systems. If you need to use a - specific dbm implementation (e.g. :mod:`gdbm`), you can pass that - module as *dbmtype*. - - Note that using this class directly is not cross-platform. For best - compatibility across platforms, always use the :func:`Session()` - function to create sessions. - - -.. class:: FileSession(req[, sid[, secret[, timeout[, lock[, fast_cleanup[, verify_cleanup]]]]]]) - - New in version 3.2.0. - - This class provides session storage using a separate file for each - session. It is a subclass of :mod:`BaseSession`. - - Session data is stored in a separate file for each session. These - files are not deleted when the server process is stopped, so - sessions are persistent across server restarts. The session files - are saved in a directory named mp_sess in the temporary directory - returned by the ``tempfile.gettempdir()`` standard library - function. An alternate path can be set using - ``PythonOption mod_python.file_session.database_directory /path/to/directory``. - This directory must exist and be readable and writeable by the apache process. - - Note that the above name for the ``PythonOption`` setting was - changed to these values in mod_python 3.3. If you need to retain - compatibility with older versions of mod_python, you should - continue to use the now obsolete ``session_directory`` option. - - Expired session files are periodically removed by the cleanup mechanism. - The behaviour of the cleanup can be controlled using the - *fast_cleanup* and *verify_cleanup* parameters, as well as - ``PythonOption mod_python.file_session.cleanup_time_limit`` and - ``PythonOption mod_python.file_session.cleanup_grace_period``. - - - * *fast_cleanup* - - A boolean value used to turn on FileSession cleanup - optimization. Default is *True* and will result in reduced - cleanup time when there are a large number of session files. - - When *fast_cleanup* is True, the modification time for the - session file is used to determine if it is a candidate for - deletion. If ``(current_time - file_modification_time) > (timeout + grace_period)``, - the file will be a candidate for - deletion. If *verify_cleanup* is False, no futher checks will be - made and the file will be deleted. - - If *fast_cleanup* is False, the session file will unpickled and - it's timeout value used to determine if the session is a - candidate for deletion. *fast_cleanup* = ``False`` implies - *verify_cleanup* = ``True``. - - The timeout used in the fast_cleanup calculation is same as the - timeout for the session in the current request running the - filesession_cleanup. If your session objects are not using the - same timeout, or you are manually setting the timeout for a - particular session with ``set_timeout()``, you will need to set - *verify_cleanup* = ``True``. - - The value of *fast_cleanup* can also be set using - ``PythonOption mod_python.file_session.enable_fast_cleanup``. - - * *verify_cleanup* - - Boolean value used to optimize the FileSession cleanup process. - Default is ``True``. - - If *verify_cleanup* is True, the session file which is being - considered for deletion will be unpickled and its timeout value - will be used to decide if the file should be deleted. - - When *verify_cleanup* is False, the timeout value for the - current session will be used in to determine if the session has - expired. In this case, the session data will not be read from - disk, which can lead to a substantial performance improvement - when there are a large number of session files, or where each - session is saving a large amount of data. However this may - result in valid sessions being deleted if all the sessions are - not using a the same timeout value. - - The value of *verify_cleanup* can also be set using - ``PythonOption mod_python.file_session.verify_session_timeout``. - - * ``PythonOption mod_python.file_session.cleanup_time_limit [value]`` - Integer value in seconds. Default is 2 seconds. - - Session cleanup could potentially take a long time and be both - cpu and disk intensive, depending on the number of session files - and if each file needs to be read to verify the timeout value. To - avoid overloading the server, each time filesession_cleanup is - called it will run for a maximum of *session_cleanup_time_limit* - seconds. Each cleanup call will resume from where the previous - call left off so all session files will eventually be checked. - - Setting *session_cleanup_time_limit* to 0 will disable this - feature and filesession_cleanup will run to completion each time - it is called. - - * ``PythonOption mod_python.file_session.cleanup_grace_period [value]`` - Integer value in seconds. Default is 240 seconds. This value is added - to the session timeout in determining if a session file should be - deleted. - - There is a small chance that a the cleanup for a given session - file may occur at the exact time that the session is being - accessed by another request. It is possible under certain - circumstances for that session file to be saved in the other - request only to be immediately deleted by the cleanup. To avoid - this race condition, a session is allowed a *grace_period* before - it is considered for deletion by the cleanup. As long as the - grace_period is longer that the time it takes to complete the - request (which should normally be less than 1 second), the - session will not be mistakenly deleted by the cleanup. - - The default value should be sufficient for most applications. - - -.. class:: MemorySession(req[, sid[, secret[, timeout[, lock]]]]) - - This class provides session storage using a global dictionary. This - class provides by far the best performance, but cannot be used in a - multi-process configuration, and also consumes memory for every - active session. It also cannot be used where multiple Python - interpreters are used within the one Apache process and it is - necessary to share sessions between applications running in the - distinct interpreters. - - Note that using this class directly is not cross-platform. For best - compatibility across platforms, always use the :func:`Session()` - function to create sessions. - - -.. _pyapi-sess-example: - - -Examples --------- - -The following example demonstrates a simple hit counter.:: - - from mod_python import Session - - def handler(req): - session = Session.Session(req) - - try: - session['hits'] += 1 - except: - session['hits'] = 1 - - session.save() - - req.content_type = 'text/plain' - req.write('Hits: %d\n' % session['hits']) - return apache.OK - - -.. _pyapi-psp: - -:mod:`psp` -- Python Server Pager -================================= - -.. module:: psp - :synopsis: Python Server Pages -.. moduleauthor:: Gregory Trubetskoy grisha@modpython.org - - -The :mod:`psp` module provides a way to convert text documents -(including, but not limited to HTML documents) containing Python code -embedded in special brackets into pure Python code suitable for -execution within a mod_python handler, thereby providing a versatile -mechanism for delivering dynamic content in a style similar to ASP, -JSP and others. - -The parser used by :mod:`psp` is written in C (generated using flex) -and is therefore very fast. - -See :ref:`hand-psp` for additional PSP information. - -Inside the document, Python :dfn:`code` needs to be surrounded by -``'<%'`` and ``'%>'``. Python :dfn:`expressions` are enclosed in -``'<%='`` and ``'%>'``. A :dfn:`directive` can be enclosed in -``'<%@'`` and ``'%>'``. A comment (which will never be part of -the resulting code) can be enclosed in ``'<%--'`` and ``'--%>'`` - -Here is a primitive PSP page that demonstrated use of both code and -expression embedded in an HTML document:: - - <html> - <% - import time - %> - Hello world, the time is: <%=time.strftime("%Y-%m-%d, %H:%M:%S")%> - </html> - - -Internally, the PSP parser would translate the above page into the -following Python code:: - - req.write("""<html> - """) - import time - req.write(""" - Hello world, the time is: """); req.write(str(time.strftime("%Y-%m-%d, %H:%M:%S"))); req.write(""" - </html> - """) - -This code, when executed inside a handler would result in a page -displaying words ``'Hello world, the time is: '`` followed by current time. - -Python code can be used to output parts of the page conditionally or -in loops. Blocks are denoted from within Python code by -indentation. The last indentation in Python code (even if it is a -comment) will persist through the document until either end of -document or more Python code. - -Here is an example:: - - <html> - <% - for n in range(3): - # This indent will persist - %> - <p>This paragraph will be - repeated 3 times.</p> - <% - # This line will cause the block to end - %> - This line will only be shown once.<br> - </html> - -The above will be internally translated to the following Python code:: - - req.write("""<html> - """) - for n in range(3): - # This indent will persist - req.write(""" - <p>This paragraph will be - repeated 3 times.</p> - """) - # This line will cause the block to end - req.write(""" - This line will only be shown once.<br> - </html> - """) - -The parser is also smart enough to figure out the indent if the last -line of Python ends with ``':'`` (colon). Considering this, and that the -indent is reset when a newline is encountered inside ``'<% %>'``, the -above page can be written as:: - - <html> - <% - for n in range(3): - %> - <p>This paragraph will be - repeated 3 times.</p> - <% - %> - This line will only be shown once.<br> - </html> - -However, the above code can be confusing, thus having descriptive -comments denoting blocks is highly recommended as a good practice. - -The only directive supported at this time is ``include``, here is -how it can be used:: - - <%@ include file="/file/to/include"%> - -If the :func:`parse` function was called with the *dir* argument, then -the file can be specified as a relative path, otherwise it has to be -absolute:: - -.. class:: PSP(req[, filename[, string[, vars]]]) - - This class represents a PSP object. - - *req* is a request object; *filename* and *string* are optional - keyword arguments which indicate the source of the PSP code. Only - one of these can be specified. If neither is specified, - ``req.filename`` is used as *filename*. - - *vars* is a dictionary of global variables. Vars passed in the - :meth:`run` method will override vars passed in here. - - This class is used internally by the PSP handler, but can also be - used as a general purpose templating tool. - - When a file is used as the source, the code object resulting from - the specified file is stored in a memory cache keyed on file name - and file modification time. The cache is global to the Python - interpreter. Therefore, unless the file modification time changes, - the file is parsed and resulting code is compiled only once per - interpreter. - - The cache is limited to 512 pages, which depending on the size of - the pages could potentially occupy a significant amount of - memory. If memory is of concern, then you can switch to dbm file - caching. Our simple tests showed only 20% slower performance using - bsd db. You will need to check which implementation :mod:`anydbm` - defaults to on your system as some dbm libraries impose a limit on - the size of the entry making them unsuitable. Dbm caching can be - enabled via ``mod_python.psp.cache_database_filename`` Python - option, e.g.:: - - PythonOption mod_python.psp.cache_database_filename "/tmp/pspcache.dbm" - - Note that the dbm cache file is not deleted when the server - restarts. - - Unlike with files, the code objects resulting from a string are - cached in memory only. There is no option to cache in a dbm file at - this time. - - Note that the above name for the option setting was only changed to - this value in mod_python 3.3. If you need to retain backward - compatibility with older versions of mod_python use the - ``PSPDbmCache`` option instead. - - .. method:: PSP.run([vars[, flush]]) - - This method will execute the code (produced at object - initialization time by parsing and compiling the PSP - source). Optional argument *vars* is a dictionary keyed by - strings that will be passed in as global variables. Optional - argument *flush* is a boolean flag indicating whether output - should be flushed. The default is not to flush output. - - Additionally, the PSP code will be given global variables - ``req``, ``psp``, ``session`` and ``form``. A session will be - created and assigned to ``session`` variable only if ``session`` - is referenced in the code (the PSP handler examines ``co_names`` - of the code object to make that determination). Remember that a - mere mention of ``session`` will generate cookies and turn on - session locking, which may or may not be what you - want. Similarly, a mod_python :class:`FieldStorage` object will - be instantiated if ``form`` is referenced in the code. - - The object passed in ``psp`` is an instance of - :class:`PSPInterface`. - - - .. method:: PSP.display_code() - - Returns an HTML-formatted string representing a side-by-side - listing of the original PSP code and resulting Python code - produced by the PSP parser. - - Here is an example of how :class:`PSP` can be used as a templating - mechanism: - - The template file:: - - <html> - <!-- This is a simple psp template called template.html --> - <h1>Hello, <%=what%>!</h1> - </html> - - The handler code:: - - from mod_python import apache, psp - - def handler(req): - template = psp.PSP(req, filename='template.html') - template.run({'what':'world'}) - return apache.OK - -.. class:: PSPInterface() - - An object of this class is passed as a global variable ``psp`` to - the PSP code. Objects of this class are instantiated internally and - the interface to :meth:`__init__` is purposely undocumented. - - .. method:: set_error_page(filename) - - Used to set a psp page to be processed when an exception - occurs. If the path is absolute, it will be appended to document - root, otherwise the file is assumed to exist in the same directory - as the current page. The error page will receive one additional - variable, ``exception``, which is a 3-tuple returned by - ``sys.exc_info()``. - - .. method:: apply_data(object[, **kw]) - - This method will call the callable object *object*, passing form - data as keyword arguments, and return the result. - - .. method:: redirect(location[, permanent=0]) - - This method will redirect the browser to location - *location*. If *permanent* is true, then - :const:`MOVED_PERMANENTLY` will be sent (as opposed to - :const:`MOVED_TEMPORARILY`). - - .. note:: - - Redirection can only happen before any data is sent to the - client, therefore the Python code block calling this method must - be at the very beginning of the page. Otherwise an - :exc:`IOError` exception will be raised. - - Example:: - - <% - - # note that the '<' above is the first byte of the page! - psp.redirect('http://www.modpython.org') - %> - -Additionally, the :mod:`psp` module provides the following low level -functions: - -.. function:: parse(filename[, dir]) - - This function will open file named *filename*, read and parse its - content and return a string of resulting Python code. - - If *dir* is specified, then the ultimate filename to be parsed is - constructed by concatenating *dir* and *filename*, and the argument - to ``include`` directive can be specified as a relative path. (Note - that this is a simple concatenation, no path separator will be - inserted if *dir* does not end with one). - -.. function:: parsestring(string) - - This function will parse contents of *string* and return a string - of resulting Python code. - - -.. _pyapi-httpdconf: - -:mod:`httpdconf` -- HTTPd Configuration -======================================= - -.. module:: httpdconf - :synopsis: HTTPd Configuration -.. moduleauthor:: Gregory Trubetskoy grisha@modpython.org - - -The :mod:`httpdconf` module provides a simple framework for generating -Apache HTTP Server configuration in Python. It was inspired by HTMLgen -by Robin Friedrich. :mod:`httpdconf` appeared in 2002 as part of the -mod_python test framework and its use has been primarily limited to -mod_python tests. This latest version of mod_python includes many -improvements to :mod:`httpdconf` and makes it part of the Python API. - -The basic idea is that an Apache configuration directive can be -specified as Python code, e.g.:: - - >>> from mod_python.httpdconf import * - >>> conf = DocumentRoot('/path/to/htdocs') - -The resulting object renders itself as a valid Apache directive when -converted to string:: - - >>> print conf - DocumentRoot /path/to/htdocs - -While the ``__repr__`` method of the object returns the string of -Python code used to construct it in the first place:: - - >>> print `conf` - DocumentRoot('/path/to/htdocs') - -Classes for Directive types ---------------------------- - -:mod:`httpdconf` separates all Apache directives into the following -classes. - -.. class:: Directive(name, value[, flipslash=1]) - - This is a simple directive. Its syntax is the directive *name* - followed by a string *value*. Even though the Apache directives can - be followed by multiple arguments, :mod:`httpdconf` views it as - just a single string, e.g. ``CustomLog('logs/access_log combined')``. - -.. class:: Container(*args, [only_if=None]) - - A Container groups directives specified as *args* into a single - object. args can include other containers as well. The optional - *only_if* argument is a string of Python that is evaled at - directive render time. The directive is rendered only if the eval - return a true value. - - >>> c = Container(CustomLog('logs/access_log combined'), ErrorLog('logs/error_log')) - >>> print c - CustomLog logs/access_log combined - ErrorLog logs/error_log - - >>> print `c` - Container( - CustomLog('logs/access_log combined'), - ErrorLog('logs/error_log'), - only_if='True') - ) - - Note how elements within a Container are properly indented when - rendered as Python code. A more practical example of only_if may be - ``only_if="mod_python.version.HTTPD_VERSION[0:3] == '2.4'"``. - - - .. method:: append(value) - - Appends an object to a container. There is no difference - between specifying contained object at creation time or - appending elements to a container later. - -.. class:: ContainerTag(tag, attr, args[, flipslash=1)] - - A ContainerTag is a tag that contains other tags, - e.g. ``Directory`` or ``Location``. - -.. class:: Comment(comment) - - A Comment renders itself as an Apache configuration comment. There - is no need to include ``#`` as part of the *comment* - string. Multi-line comments can be specified by a newline - charater. Example:: - - >>> c = Comment("\nThis is\na comment\n") - >>> print c - # - # This is - # a comment - - >>> print `c` - Comment('\n' - 'This is\n' - 'a comment\n') - - -:mod:`httpdconf` includes a basic set of Apache configuration -directives (see code for which ones), but any Apache configuration -directive can be trivially created by sub-classing one of the above -classes:: - - >>> from mod_python.httpdconf import * - >>> class MyDirective(Directive): - ... def __init__(self, val): - ... Directive.__init__(self, self.__class__.__name__, val) - ... - >>> c = MyDirective('foo') - >>> print c - MyDirective foo - - - - diff --git a/doc-html/_sources/ssi.txt b/doc-html/_sources/ssi.txt deleted file mode 100644 index cd265c76da6c3aa6d67eb02206c05314aebbf183..0000000000000000000000000000000000000000 --- a/doc-html/_sources/ssi.txt +++ /dev/null @@ -1,268 +0,0 @@ -.. _ssi: - -******************** -Server Side Includes -******************** - -.. _ssi-overview: - -Overview of SSI -=============== - -SSI (Server Side Includes) are directives that are placed in HTML pages, -and evaluated on the server while the pages are being served. They let you -add dynamically generated content to an existing HTML page, without having -to serve the entire page via a CGI program, or other dynamic technology -such as a mod_python handler. - -SSI directives have the following syntax::: - - <!--#element attribute=value attribute=value ... --> - - -It is formatted like an HTML comment, so if you don't have SSI correctly -enabled, the browser will ignore it, but it will still be visible in the -HTML source. If you have SSI correctly configured, the directive will be -replaced with its results. - -For a more thorough description of the SSI mechanism and how to enable it, -see the `SSI tutorial <http://httpd.apache.org/docs/2.0/howto/ssi.html>`_ -provided with the Apache documentation. - -Version 3.3 of mod_python introduces support for using Python code within -SSI files. Note that mod_python honours the intent of the Apache -``IncludesNOEXEC`` option to the ``Options`` directive. That is, if -``IncludesNOEXEC`` is enabled, then Python code within a SSI file will -not be executed. - - -.. _ssi-python-code: - -Using Python Code -================= - -The extensions to mod_python to allow Python code to be used in conjunction -with SSI introduces the new SSI directive called ``'python'``. This directive -can be used in two forms, these being ``'eval'`` and ``'exec'`` modes. In the case -of ``'eval'``, a Python expression is used and it is the result of that -expression which is substituted in place into the page.:: - - <!--#python eval="10*'HELLO '" --> - <!--#python eval="len('HELLO')" --> - - -Where the result of the expression is not a string, the value will be -automatically converted to a string by applying ``'str()'`` to the value. - -In the case of ``'exec'`` a block of Python code may be included. For any -output from this code to appear in the page, it must be written back -explicitly as being part of the response. As SSI are processed by an Apache -output filter, this is done by using an instance of the mod_python -``filter`` object which is pushed into the global data set available to -the code.:: - - <!--#python exec=" - filter.write(10*'HELLO ') - filter.write(str(len('HELLO'))) - " --> - -Any Python code within the ``'exec'`` block must have a zero first level -indent. You cannot start the code block with an arbitrary level of indent -such that it lines up with any indenting used for surrounding HTML -elements. - -Although the mod_python ``filter`` object is not a true file object, that -it provides the ``write()`` method is sufficient to allow the ``print`` -statement to be used on it directly. This will avoid the need to explicitly -convert non string objects to a string before being output.:: - - <!--#python exec=" - print >> filter, len('HELLO') - " --> - - -.. _ssi-data-scope: - -Scope of Global Data -==================== - -Multiple instances of ``'eval'`` or ``'exec'`` code blocks may be used within the -one page. Any changes to or creation of global data which is performed -within one code block will be reflected in any following code blocks. -Global data constitutes variables as well as module imports, function and -class definitions.:: - - <!--#python exec=" - import cgi, time, os - def _escape(object): - return cgi.escape(str(object)) - now = time.time() - " --> - <html> - <body> - <pre> - <!--#python eval="_escape(time.asctime(time.localtime(now)))"--> - - <!--#python exec=" - keys = os.environ.keys() - keys.sort() - for key in keys: - print >> filter, _escape(key), - print >> filter, '=', - print >> filter, _escape(repr(os.environ.get(key))) - " --> - </pre> - </body> - </html> - - -The lifetime of any global data is for the current request only. If data -must persist between requests, it must reside in external modules and as -necessary be protected against multithreaded access in the event that a -multithreaded Apache MPM is used. - - -.. _ssi-globals: - -Pre-populating Globals -====================== - -Any Python code which appears within the page has to be compiled each time -the page is accessed before it is executed. In other words, the compiled -code is not cached between requests. To limit such recompilation and to -avoid duplication of common code amongst many pages, it is preferable to -pre-populate the global data from within a mod_python handler prior to the -page being processed. - -In most cases, a fixup handler would be used for this purpose. For this to -work, first need to configure Apache so that it knows to call the fixup -handler.:: - - PythonFixupHandler _handlers - - -The implementation of the fixup handler contained in ``_handlers.py`` -then needs to create an instance of a Python dictionary, store that in the -mod_python request object as ``ssi_globals`` and then populate that -dictionary with any data to be available to the Python code executing -within the page.:: - - from mod_python import apache - - import cgi, time - - def _escape(object): - return cgi.escape(str(object)) - - def _header(filter): - print >> filter, '...' - - def _footer(filter): - print >> filter, '...' - - def fixuphandler(req): - req.ssi_globals = {} - req.ssi_globals['time'] = time - req.ssi_globals['_escape'] = _escape - req.ssi_globals['_header'] = _header - req.ssi_globals['_footer'] = _footer - return apache.OK - - -This is most useful where it is necessary to insert common information such -as headers, footers or menu panes which are dynamically generated into many -pages.:: - - <!--#python exec=" - now = time.time() - " --> - <html> - <body> - <!--#python exec="_header(filter)" --> - <pre> - <!--#python eval="_escape(time.asctime(time.localtime(now)))"--> - </pre> - <!--#python exec="_footer(filter)" --> - </body> - </html> - -.. _ssi-conditionals: - -Conditional Expressions -======================= - -SSI allows for some programmability in its own right through the use of -conditional expressions. The structure of this conditional construct is::: - - <!--#if expr="test_condition" --> - <!--#elif expr="test_condition" --> - <!--#else --> - <!--#endif --> - - -A test condition can be any sort of logical comparison, either comparing -values to one another, or testing the 'truth' of a particular value. - -The source of variables used in conditional expressions is distinct from -the set of global data used by the Python code executed within a page. -Instead, the variables are sourced from the ``subprocess_env`` table -object contained within the request object. The values of these variables -can be set from within a page using the SSI ``'set'`` directive, or by a range -of other Apache directives within the Apache configuration files such as -``BrowserMatchNoCase`` and ``SetEnvIf``. - -To set these variables from within a mod_python handler, the -``subprocess_env`` table object would be manipulated directly through -the request object.:: - - from mod_python import apache - - def fixuphandler(req): - debug = req.get_config().get('PythonDebug', '0') - req.subprocess_env['DEBUG'] = debug - return apache.OK - - -If being done from within Python code contained within the page itself, the -request object would first have to be accessed via the filter object.:: - - <!--#python exec=" - debug = filter.req.get_config().get('PythonDebug', '0') - filter.req.subprocess_env['DEBUG'] = debug - " --> - <html> - <body> - <!--#if expr="${DEBUG} != 0" --> - DEBUG ENABLED - <!--#else --> - DEBUG DISABLED - <!--#endif --> - </body> - </html> - - -.. _ssi-output-filter: - -Enabling INCLUDES Filter -======================== - -SSI is traditionally enabled using the ``AddOutputFilter`` directive in -the Apache configuration files. Normally this would be where the request -mapped to a static file.:: - - AddOutputFilter INCLUDES .shtml - -When mod_python is being used, the ability to dynamically enable output -filters for the current request can instead be used. This could be done -just for where the request maps to a static file, but may just as easily be -carried out where the content of a response is generated dynamically. In -either case, to enable SSI for the current request, the -:meth:`request.add_output_filter` method of the mod_python request object would be -used.:: - - from mod_python import apache - - def fixuphandler(req): - req.add_output_filter('INCLUDES') - return apache.OK - diff --git a/doc-html/_sources/tutorial.txt b/doc-html/_sources/tutorial.txt deleted file mode 100644 index 27729a0922d46d9b510178d614ebd17b278b9cd1..0000000000000000000000000000000000000000 --- a/doc-html/_sources/tutorial.txt +++ /dev/null @@ -1,455 +0,0 @@ - -.. _tutorial: - -******** -Tutorial -******** - -*So how can I make this work?* - -This is a quick guide to getting started with mod_python programming -once you have it installed. This is not an installation manual. - -It is also highly recommended to read (at least the top part of) -the section :ref:`pythonapi` after completing this tutorial. - -.. _tut-pub: - -A Quick Start with the Publisher Handler -======================================== - -This section provides a quick overview of the Publisher handler for -those who would like to get started without getting into too much -detail. A more thorough explanation of how mod_python handlers work -and what a handler actually is follows on in the later sections of the -tutorial. - -The :ref:`hand-pub` is provided as one of the standard -mod_python handlers. To get the publisher handler working, you will -need the following lines in your config:: - - AddHandler mod_python .py - PythonHandler mod_python.publisher - PythonDebug On - -The following example demonstrates a simple feedback form. The form -asks for a name, e-mail address and a comment which are then used to -construct and send a message to the webmaster. This simple -application consists of two files: :file:`form.html` - the form to -collect the data, and :file:`form.py` - the target of the form's -action. - -Here is the html for the form:: - - <html> - Please provide feedback below: - <p> - <form action="form.py/email" method="POST"> - - Name: <input type="text" name="name"><br> - Email: <input type="text" name="email"><br> - Comment: <textarea name="comment" rows=4 cols=20></textarea><br> - <input type="submit"> - - </form> - </html> - -The ``action`` element of the ``<form>`` tag points to -``form.py/email``. We are going to create a file called -:file:`form.py`, like this:: - - import smtplib - - WEBMASTER = "webmaster" # webmaster e-mail - SMTP_SERVER = "localhost" # your SMTP server - - def email(req, name, email, comment): - - # make sure the user provided all the parameters - if not (name and email and comment): - return "A required parameter is missing, \ - please go back and correct the error" - - # create the message text - msg = """\ - From: %s - Subject: feedback - To: %s - - I have the following comment: - - %s - - Thank You, - - %s - - """ % (email, WEBMASTER, comment, name) - - # send it out - conn = smtplib.SMTP(SMTP_SERVER) - conn.sendmail(email, [WEBMASTER], msg) - conn.quit() - - # provide feedback to the user - s = """\ - <html> - - Dear %s,<br> - Thank You for your kind comments, we - will get back to you shortly. - - </html>""" % name - - return s - -When the user clicks the Submit button, the publisher handler will -load the :func:`email` function in the :mod:`form` module, -passing it the form fields as keyword arguments. It will also pass the -request object as ``req``. - -You do not have to have ``req`` as one of the arguments if you do not -need it. The publisher handler is smart enough to pass your function -only those arguments that it will accept. - -The data is sent back to the browser via the return value of the -function. - -Even though the Publisher handler simplifies mod_python programming a -great deal, all the power of mod_python is still available to this -program, since it has access to the request object. You can do all the -same things you can do with a "native" mod_python handler, e.g. set -custom headers via ``req.headers_out``, return errors by raising -:exc:`apache.SERVER_ERROR` exceptions, write or read directly to -and from the client via :meth:`req.write()` and :meth:`req.read()`, -etc. - -Read Section :ref:`hand-pub` for more information on the publisher -handler. - -.. _tut-overview: - -Quick Overview of how Apache Handles Requests -============================================= - -Apache processes requests in :dfn:`phases`. For example, the first -phase may be to authenticate the user, the next phase to verify -whether that user is allowed to see a particular file, then (next -phase) read the file and send it to the client. A typical static file -request involves three phases: (1) translate the requested URI to a -file location (2) read the file and send it to the client, then (3) -log the request. Exactly which phases are processed and how varies -greatly and depends on the configuration. - -A :dfn:`handler` is a function that processes one phase. There may be -more than one handler available to process a particular phase, in -which case they are called by Apache in sequence. For each of the -phases, there is a default Apache handler (most of which by default -perform only very basic functions or do nothing), and then there are -additional handlers provided by Apache modules, such as mod_python. - -Mod_python provides every possible handler to Apache. Mod_python -handlers by default do not perform any function, unless specifically -told so by a configuration directive. These directives begin with -``'Python'`` and end with ``'Handler'`` -(e.g. ``PythonAuthenHandler``) and associate a phase with a Python -function. So the main function of mod_python is to act as a dispatcher -between Apache handlers and Python functions written by a developer -like you. - -The most commonly used handler is ``PythonHandler``. It handles the -phase of the request during which the actual content is -provided. Because it has no name, it is sometimes referred to as as -:dfn:`generic` handler. The default Apache action for this handler is -to read the file and send it to the client. Most applications you will -write will provide this one handler. To see all the possible -handlers, refer to Section :ref:`directives`. - -.. _tut-what-it-do: - -So what Exactly does Mod-python do? -=================================== - -Let's pretend we have the following configuration:: - - <Directory /mywebdir> - AddHandler mod_python .py - PythonHandler myscript - PythonDebug On - </Directory> - -Note: ``/mywebdir`` is an absolute physical path in this case. - -And let's say that we have a python program (Windows users: substitute -forward slashes for backslashes) :file:`/mywedir/myscript.py` that looks like -this:: - - from mod_python import apache - - def handler(req): - - req.content_type = "text/plain" - req.write("Hello World!") - - return apache.OK - -Here is what's going to happen: The ``AddHandler`` directive tells -Apache that any request for any file ending with :file:`.py` in the -:file:`/mywebdir` directory or a subdirectory thereof needs to be -processed by mod_python. The ``'PythonHandler myscript'`` directive -tells mod_python to process the generic handler using the -`myscript` script. The ``'PythonDebug On'`` directive instructs -mod_python in case of an Python error to send error output to the -client (in addition to the logs), very useful during development. - -When a request comes in, Apache starts stepping through its request -processing phases calling handlers in mod_python. The mod_python -handlers check whether a directive for that handler was specified in -the configuration. (Remember, it acts as a dispatcher.) In our -example, no action will be taken by mod_python for all handlers except -for the generic handler. When we get to the generic handler, -mod_python will notice ``'PythonHandler myscript'`` directive and do -the following: - -* If not already done, prepend the directory in which the - ``PythonHandler`` directive was found to ``sys.path``. - -* Attempt to import a module by name ``myscript``. (Note that if - ``myscript`` was in a subdirectory of the directory where - ``PythonHandler`` was specified, then the import would not work - because said subdirectory would not be in the ``sys.path``. One - way around this is to use package notation, e.g. - ``'PythonHandler subdir.myscript'``.) - -* Look for a function called ``handler`` in module ``myscript``. - -* Call the function, passing it a request object. (More on what a - request object is later). - -* At this point we're inside the script, let's examine it line-by-line: - - * :: - - from mod_python import apache - - This imports the apache module which provides the interface to - Apache. With a few rare exceptions, every mod_python program will have - this line. - - .. index:: - single: handler - - * :: - - def handler(req): - - This is our :dfn:`handler` function declaration. It - is called ``'handler'`` because mod_python takes the name of the - directive, converts it to lower case and removes the word - ``'python'``. Thus ``'PythonHandler'`` becomes - ``'handler'``. You could name it something else, and specify it - explicitly in the directive using ``'::'``. For example, if the - handler function was called ``'spam'``, then the directive would - be ``'PythonHandler myscript::spam'``. - - Note that a handler must take one argument - the :ref:`pyapi-mprequest`. - The request object is an object that provides all of the - information about this particular request - such as the IP of - client, the headers, the URI, etc. The communication back to the - client is also done via the request object, i.e. there is no - "response" object. - - * :: - - req.content_type = "text/plain" - - This sets the content type to ``'text/plain'``. The default is - usually ``'text/html'``, but because our handler does not produce - any html, ``'text/plain'`` is more appropriate. You should always - make sure this is set *before* any call to ``'req.write'``. When - you first call ``'req.write'``, the response HTTP header is sent - to the client and all subsequent changes to the content type (or - other HTTP headers) have no effect. - - * :: - - req.write("Hello World!") - - This writes the ``'Hello World!'`` string to the client. - - * :: - - return apache.OK - - This tells Apache that everything went OK and that the request has - been processed. If things did not go OK, this line could return - :const:`apache.HTTP_INTERNAL_SERVER_ERROR` or - :const:`apache.HTTP_FORBIDDEN`. When things do not go OK, Apache - logs the error and generates an error message for the client. - -.. note:: - - It is important to understand that in order for the handler code to - be executed, the URL needs not refer specficially to - :file:`myscript.py`. The only requirement is that it refers to a - :file:`.py` file. This is because the ``AddHandler mod_python .py`` - directive assignes mod_python to be a handler for a file *type* - (based on extention ``.py``), not a specific file. Therefore the - name in the URL does not matter, in fact the file referred to in the - URL doesn't event have to exist. Given the above configuration, - ``'http://myserver/mywebdir/myscript.py'`` and - ``'http://myserver/mywebdir/montypython.py'`` would yield the exact - same result. - - -.. _tut-more-complicated: - -Now something More Complicated - Authentication -=============================================== - -Now that you know how to write a basic handler, let's try -something more complicated. - -Let's say we want to password-protect this directory. We want the -login to be ``'spam'``, and the password to be ``'eggs'``. - -First, we need to tell Apache to call our *authentication* -handler when authentication is needed. We do this by adding the -``PythonAuthenHandler``. So now our config looks like this:: - - <Directory /mywebdir> - AddHandler mod_python .py - PythonHandler myscript - PythonAuthenHandler myscript - PythonDebug On - </Directory> - -Notice that the same script is specified for two different -handlers. This is fine, because if you remember, mod_python will look -for different functions within that script for the different handlers. - -Next, we need to tell Apache that we are using Basic HTTP -authentication, and only valid users are allowed (this is fairly basic -Apache stuff, so we're not going to go into details here). Our config -looks like this now:: - - <Directory /mywebdir> - AddHandler mod_python .py - PythonHandler myscript - PythonAuthenHandler myscript - PythonDebug On - AuthType Basic - AuthName "Restricted Area" - require valid-user - </Directory> - -Note that depending on which version of Apache is being used, you may need -to set either the \code{AuthAuthoritative} or ``AuthBasicAuthoritative`` -directive to ``Off`` to tell Apache that you want allow the task of -performing basic authentication to fall through to your handler. - -Now we need to write an authentication handler function in -:file:`myscript.py`. A basic authentication handler would look like -this:: - - from mod_python import apache - - def authenhandler(req): - - pw = req.get_basic_auth_pw() - user = req.user - - if user == "spam" and pw == "eggs": - return apache.OK - else: - return apache.HTTP_UNAUTHORIZED - -Let's look at this line by line: - -* :: - - def authenhandler(req): - - This is the handler function declaration. This one is called - ``authenhandler`` because, as we already described above, - mod_python takes the name of the directive - (``PythonAuthenHandler``), drops the word ``'Python'`` and converts - it lower case. - -* :: - - pw = req.get_basic_auth_pw() - - This is how we obtain the password. The basic HTTP authentication - transmits the password in base64 encoded form to make it a little - bit less obvious. This function decodes the password and returns it - as a string. Note that we have to call this function before obtaining - the user name. - -* :: - - user = req.user - - This is how you obtain the username that the user entered. - -* :: - - if user == "spam" and pw == "eggs": - return apache.OK - - - We compare the values provided by the user, and if they are what we - were expecting, we tell Apache to go ahead and proceed by returning - :const:`apache.OK`. Apache will then consider this phase of the - request complete, and proceed to the next phase. (Which in this case - would be :func:`handler()` if it's a ``'.py'`` file). - -* :: - - else: - return apache.HTTP_UNAUTHORIZED - - Else, we tell Apache to return :const:`HTTP_UNAUTHORIZED` to the - client, which usually causes the browser to pop a dialog box asking - for username and password. - -.. _tut-404-handler: - -Your Own 404 Handler -==================== - -In some cases, you may wish to return a 404 (:const:`HTTP_NOT_FOUND`) or -other non-200 result from your handler. There is a trick here. if you -return :const:`HTTP_NOT_FOUND` from your handler, Apache will handle -rendering an error page. This can be problematic if you wish your handler -to render it's own error page. - -In this case, you need to set ``req.status = apache.HTTP_NOT_FOUND``, -render your page, and then ``return(apache.OK)``:: - - from mod_python import apache - - def handler(req): - if req.filename[-17:] == 'apache-error.html': - # make Apache report an error and render the error page - return(apache.HTTP_NOT_FOUND) - if req.filename[-18:] == 'handler-error.html': - # use our own error page - req.status = apache.HTTP_NOT_FOUND - pagebuffer = 'Page not here. Page left, not know where gone.' - else: - # use the contents of a file - pagebuffer = open(req.filename, 'r').read() - - # fall through from the latter two above - req.write(pagebuffer) - return(apache.OK) - -Note that if wishing to returning an error page from a handler phase other -than the response handler, the value ``apache.DONE`` must be returned -instead of ``apache.OK``. If this is not done, subsequent handler phases -will still be run. The value of ``apache.DONE`` indicates that processing -of the request should be stopped immediately. If using stacked response -handlers, then ``apache.DONE`` should also be returned in that situation -to prevent subsequent handlers registered for that phase being run if -appropriate. diff --git a/doc-html/about.html b/doc-html/about.html deleted file mode 100644 index 9be8914fd9577bfed0a40430ebee4fda65917b0c..0000000000000000000000000000000000000000 --- a/doc-html/about.html +++ /dev/null @@ -1,121 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>About these documents — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="#" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Copyright" href="copyright.html" /> - <link rel="prev" title="History and License" href="license.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="copyright.html" title="Copyright" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="license.html" title="History and License" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="about-these-documents"> -<h1>About these documents<a class="headerlink" href="#about-these-documents" title="Permalink to this headline">¶</a></h1> -<p>These documents are generated from <a class="reference external" href="http://docutils.sf.net/rst.html">reStructuredText</a> sources by <a class="reference external" href="http://sphinx.pocoo.org/">Sphinx</a>, a -document processor specifically written for the Python documentation.</p> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Previous topic</h4> - <p class="topless"><a href="license.html" - title="previous chapter">History and License</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="copyright.html" - title="next chapter">Copyright</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/about.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="copyright.html" title="Copyright" - >next</a> |</li> - <li class="right" > - <a href="license.html" title="History and License" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/changes.html b/doc-html/changes.html deleted file mode 100644 index c9c7640f92383135ef488deacef3f3afaac56915..0000000000000000000000000000000000000000 --- a/doc-html/changes.html +++ /dev/null @@ -1,441 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Changes — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="History and License" href="license.html" /> - <link rel="prev" title="Server Side Includes" href="ssi.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="license.html" title="History and License" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="ssi.html" title="Server Side Includes" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="changes"> -<span id="id1"></span><h1>Changes<a class="headerlink" href="#changes" title="Permalink to this headline">¶</a></h1> -<div class="section" id="changes-from-version-3-4-1"> -<span id="changes-from-3-4-1"></span><h2>Changes from version 3.4.1<a class="headerlink" href="#changes-from-version-3-4-1" title="Permalink to this headline">¶</a></h2> -<div class="section" id="new-features"> -<h3>New Features<a class="headerlink" href="#new-features" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>Support for Python 3.3</li> -</ul> -</div> -<div class="section" id="improvements"> -<h3>Improvements<a class="headerlink" href="#improvements" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>Simpler, faster and up-to-date with latest Python code for creating/maintaining interpreter and thread state.</li> -<li>A much faster WSGI implementation (start_response now implemented in C)</li> -</ul> -</div> -</div> -<div class="section" id="changes-from-version-3-3-1"> -<span id="changes-from-3-3-1"></span><h2>Changes from version 3.3.1<a class="headerlink" href="#changes-from-version-3-3-1" title="Permalink to this headline">¶</a></h2> -<div class="section" id="id2"> -<h3>New Features<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>Create the mod_python command-line tool to report version, manage Apache configuration and instances.</li> -<li>Make httpdconf directives render themselves as Python, add the only_if conditional and comments.</li> -<li>Expose and document httpdconf, make mod_python importable outside of Apache.</li> -<li>Provide a WSGI handler.</li> -<li>Change the Copyright to reflect the new status.</li> -<li>Add support for Apache HTTP Server 2.4.</li> -<li>Add support for Python 2.7.</li> -</ul> -</div> -<div class="section" id="id3"> -<h3>Improvements<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>Improve WSGI and Python path documentation.</li> -<li>Change WSGI handler to use Location path as SCRIPT_NAME.</li> -<li>Add is_location to hlist object, skip the map_to_storage for Location-wrapped Python*Handlers.</li> -<li>Some optimizations to Python code to make it run faster.</li> -<li>Add Mutex to Apache 2.4 tests.</li> -<li>Provide and internal add_cgi_vars() implementation which does not use sub-requests.</li> -<li>Many documentation clarifications and improvements.</li> -<li>Add a test to ensure that req.write() and req.flush() do not leak memory (2.4 only).</li> -<li>Many new tests and test framework improvements.</li> -<li>Added a curl hint to the tests for easier stagin/debugging.</li> -<li>Get rid of the ancient memberlist and PyMember_Get/Set calls.</li> -<li>Add support for the c.remote_ip/addr to c.client_ip/addr change in 2.4. Add req.useragent_addr (also new in 2.4).</li> -<li>Always check C version against Py version and warn.</li> -<li>Remove APLOG_NOERRNO references.</li> -<li>A more unified and cleaned up method of keeping version information.</li> -<li>Convert documentation to the new reStructuredText format.</li> -<li>Revert to using the old importer from 3.2.</li> -<li>Replace README with README.md</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-238">MODPYTHON-238</a>) Make req.chunked and req.connection.keepalive writable. Being able to set these allows chunking to be turned off when HTTP/1.1 is used but no content length supplied in response.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-226">MODPYTHON-226</a>) Make req.status_line writable.</li> -</ul> -</div> -<div class="section" id="bug-fixes"> -<h3>Bug Fixes<a class="headerlink" href="#bug-fixes" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>Make PythonCleanupHandler run again.</li> -<li>Use PCapsule API instead of PyCObject for Python 2.7+.</li> -<li>Fix SCRIPT_NAME and PATH_INFO inconsistencies so that the WSGI handler behaves correctly.</li> -<li>Remove with-python-src configure option as it is no longer used to build the docs.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-243">MODPYTHON-243</a>) Fixed format string error.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-250">MODPYTHON-250</a>) Fixed MacOS X (10.5) Leopard 64 bit architecture problems.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-249">MODPYTHON-249</a>) Fixed incorrect use of APR bucket brigades shown up by APR 1.3.2.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-245">MODPYTHON-245</a>) Fix prototype of optional exported function mp_release_interpreter().</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-220">MODPYTHON-220</a>) Fix ‘import’ from same directory as PSP file.</li> -</ul> -</div> -</div> -<div class="section" id="changes-from-version-3-2-10"> -<span id="changes-from-3-2-10"></span><h2>Changes from version 3.2.10<a class="headerlink" href="#changes-from-version-3-2-10" title="Permalink to this headline">¶</a></h2> -<div class="section" id="id4"> -<h3>New Features<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-103">MODPYTHON-103</a>) New req.add_output_filter(), req.add_input_filter(), req.register_output_fiter(), req.register_input_filter() methods. These allows the dynamic registration of filters and the attaching of filters to the current request.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-104">MODPYTHON-104</a>) Support added for using Python in content being passed through “INCLUDES” output filter, or as more commonly referred to server side include (SSI) mechanism.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-108">MODPYTHON-108</a>) Added support to cookies for httponly attribute, an extension originally created by Microsoft, but now getting more widespread use in the battle against cross site-scripting attacks.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-118">MODPYTHON-118</a>) Now possible using the PythonImport directive to specify the name of a function contained in the module to be called once the designated module has been imported.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-124">MODPYTHON-124</a>) New req.auth_name() and req.auth_type() methods. These return the values associated with the AuthName and AuthType directives respectively. The req.ap_auth_type has now also been made writable so that it can be set by an authentication handler.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-130">MODPYTHON-130</a>) Added req.set_etag(), req.set_last_modified() and req.update_mtime() functions as wrappers for similar functions provided by Apache C API. These are required to effectively use the req.meets_condition() function. The documentation for req.meets_condition() has also been updated as what it previously described probably wouldn’t actually work.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-132">MODPYTHON-132</a>) New req.construct_url() method. Used to construct a fully qualified URI string incorporating correct scheme, server and port.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-144">MODPYTHON-144</a>) The “apache.interpreter” and “apache.main_server” attributes have been made publically available. These were previously private and not part of the public API.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-149">MODPYTHON-149</a>) Added support for session objects that span domains.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-153">MODPYTHON-153</a>) Added req.discard_request_body() function as wrapper for similar function provided by Apache C API. The function tests for and reads any message body in the request, simply discarding whatever it receives.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-164">MODPYTHON-164</a>) The req.add_handler(), req.register_input_filter() and req.register_output_filter() methods can now take a direct reference to a callable object as well a string which refers to a module or module::function combination by name.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-165">MODPYTHON-165</a>) Exported functions from mod_python module to be used in other third party modules for Apache. The purpose of these functions is to allow those other modules to access the mechanics of how mod_python creates interpreters, thereby allowing other modules to also embed Python and for there not to be a conflict with mod_python.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-170">MODPYTHON-170</a>) Added req._request_rec, server._server_rec and conn._conn_rec semi private members for getting accessing to underlying Apache struct as a Python CObject. These can be used for use in implementing SWIG bindings for lower level APIs of Apache. These members should be regarded as experimental and there are no guarantees that they will remain present in this specific form in the future.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-193">MODPYTHON-193</a>) Added new attribute available as req.hlist.location. For a handler executed directly as the result of a handler directive within a Location directive, this will be set to the value of the Location directive. If LocationMatch, or wildcards or regular expressions are used with Location, the value will be the matched value in the URL and not the pattern.</li> -</ul> -</div> -<div class="section" id="id5"> -<h3>Improvements<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-27">MODPYTHON-27</a>) When using mod_python.publisher, the __auth__() and __access__() functions and the __auth_realm__ string can now be nested within a class method as a well a normal function.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-90">MODPYTHON-90</a>) The PythonEnablePdb configuration option will now be ignored if Apache hasn’t been started up in single process mode.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-91">MODPYTHON-91</a>) If running Apache in single process mode with PDB enabled and the “quit” command is used to exit that debug session, an exception indicating that the PDB session has been aborted is raised rather than None being returned with a subsequent error complaining about the handler returning an invalid value.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-93">MODPYTHON-93</a>) Improved util.FieldStorage efficiency and made the interface more dictionary like.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-101">MODPYTHON-101</a>) Force an exception when handler evaluates to something other than None but is otherwise not callable. Previously an exception would not be generated if the handler evaluated to False.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-107">MODPYTHON-107</a>) Neither mod_python.publisher nor mod_python.psp explicitly flush output after writing the content of the response back to the request object. By not flushing output it is now possible to use the “CONTENT_LENGTH” output filter to add a “Content-Length” header.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-111">MODPYTHON-111</a>) Note made in session documentation that a save is required to avoid session timeouts.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-125">MODPYTHON-125</a>) The req.handler attribute is now writable. This allows a handler executing in a phase prior to the response phase to specify which Apache module will be responsible for generating the content.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-128">MODPYTHON-128</a>) Made the req.canonical_filename attribute writable. Changed the req.finfo attribute from being a tuple to an actual object. For backwards compatibility the attributes of the object can still be accessed as if they were a tuple. New code however should access the attributes as member data. The req.finfo attribute is also now writable and can be assigned to using the result of calling the new function apache.stat(). This function is a wrapper for apr_stat().</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-129">MODPYTHON-129</a>) When specifying multiple handlers for a phase, the status returned by each handler is now treated the same as how Apache would treat the status if the handler was registered using the low level C API. What this means is that whereas stacked handlers of any phase would in turn previously be executed as long as they returned apache.OK, this is no longer the case and what happens is dependent on the phase. Specifically, a handler returning apache.DECLINED no longer causes the execution of subsequent handlers for the phase to be skipped. Instead, it will move to the next of the stacked handlers. In the case of PythonTransHandler, PythonAuthenHandler, PythonAuthzHandler and PythonTypeHandler, as soon as apache.OK is returned, subsequent handlers for the phase will be skipped, as the result indicates that any processing pertinent to that phase has been completed. For other phases, stacked handlers will continue to be executed if apache.OK is returned as well as when apache.DECLINED is returned. This new interpretation of the status returned also applies to stacked content handlers listed against the PythonHandler directive even though Apache notionally only ever calls at most one content handler. Where all stacked content handlers in that phase run, the status returned from the last handler becomes the overall status from the content phase.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-141">MODPYTHON-141</a>) The req.proxyreq and req.uri attributes are now writable. This allows a handler to setup these values and trigger proxying of the current request to a remote server.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-142">MODPYTHON-142</a>) The req.no_cache and req.no_local_copy attributes are now writable.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-143">MODPYTHON-143</a>) Completely reimplemented the module importer. This is now used whenever modules are imported corresponding to any of the Python*Handler, Python*Filter and PythonImport directives. The module importer is still able to be used directly using the apache.import_module() function. The new module importer no longer supports automatic reloading of packages/modules that appear on the standard Python module search path as defined by the PythonPath directive or within an application by direct changes to sys.path. Automatic module reloading is however still performed on file based modules (not packages) which are located within the document tree where handlers are located. Locations within the document tree are however no longer added to the standard Python module search path automatically as they are maintained within a distinct importer search path. The PythonPath directive MUST not be used to point at directories within the document tree. To have additional directories be searched by the module importer, they should be listed in the mod_python.importer.path option using the PythonOption directive. This is a path similar to how PythonPath argument is supplied, but MUST not reference sys.path nor contain any directories also listed in the standard Python module search path. If an application does not appear to work under the module importer, the old module importer can be reenabled by setting the mod_python.legacy.importer option using the PythonOption directive to the value ‘*’. This option must be set in the global Apache configuration.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-152">MODPYTHON-152</a>) When in a sub request, when a request is the result of an internal redirect, or when when returning from such a request, the req.main, req.prev and req.next members now correctly return a reference to the original Python request object wrapper first created for the specific request_rec instance rather than creating a new distinct Python request object. This means that any data added explicitly to a request object can be passed between such requests.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-178">MODPYTHON-178</a>) When using mod_python.psp, if the PSP file which is the target of the request doesn’t actually exist, an apache.HTTP_NOT_FOUND server error is now returned to the client rather than raising a ValueError exception which results in a 500 internal server error. Note that if using SetHandler and the request is against the directory and no DirectoryIndex directive is specified which lists a valid PSP index file, then the same apache.HTTP_NOT_FOUND server error is returned to the client.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-196">MODPYTHON-196</a>) For completeness, added req.server.log_error() and req.connection.log_error(). The latter wraps ap_log_cerror() (when available), allowing client information to be logged along with message from a connection handler.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-206">MODPYTHON-206</a>) The attribute req.used_path_info is now modifiable and can be set from within handlers. This is equivalent to having used the AcceptPathInfo directive.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-207">MODPYTHON-207</a>) The attribute req.args is now modifiable and can be set from within handlers.</li> -</ul> -</div> -<div class="section" id="id6"> -<h3>Bug Fixes<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-38">MODPYTHON-38</a>) Fixed issue when using PSP pages in conjunction with publisher handler or where a PSP error page was being triggered, that form parameters coming from content of a POST request weren’t available or only available using a workaround. Specifically, the PSP page will now use any FieldStorage object instance cached as req.form left there by preceding code.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-43">MODPYTHON-43</a>) Nested __auth__() functions in mod_python.publisher now execute in context of globals from the file the function is in and not that of mod_python.publisher itself.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-47">MODPYTHON-47</a>) Fixed mod_python.publisher so it will not return a HTTP Bad Request response when mod_auth is being used to provide Digest authentication.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-63">MODPYTHON-63</a>) When handler directives are used within Directory or DirectoryMatch directives where wildcards or regular expressions are used, the handler directory will be set to the shortest directory matched by the directory pattern. Handler directives can now also be used within Files and FilesMatch directives and the handler directory will correctly resolve to the directory corresponding to the enclosing Directory or DirectoryMatch directive, or the directory the .htaccess file is contained in.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-76">MODPYTHON-76</a>) The FilterDispatch callback should not flush the filter if it has already been closed.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-84">MODPYTHON-84</a>) The original change to fix the symlink issue for req.sendfile() was causing problems on Win32, plus code needed to be changed to work with APR 1.2.7.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-100">MODPYTHON-100</a>) When using stacked handlers and a SERVER_RETURN exception was used to return an OK status for that handler, any following handlers weren’t being run if appropriate for the phase.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-109">MODPYTHON-109</a>) The Py_Finalize() function was being called on child process shutdown. This was being done though from within the context of a signal handler, which is generally unsafe and would cause the process to lock up. This function is no longer called on child process shutdown.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-112">MODPYTHON-112</a>) The req.phase attribute is no longer overwritten by an input or output filter. The filter.is_input member should be used to determine if a filter is an input or output filter.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-113">MODPYTHON-113</a>) The PythonImport directive now uses the apache.import_module() function to import modules to avoid reloading problems when same module is imported from a handler.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-114">MODPYTHON-114</a>) Fixed race conditions on setting sys.path when the PythonPath directive is being used as well as problems with infinite extension of path.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-120">MODPYTHON-120</a>) (<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-121">MODPYTHON-121</a>) Fixes to test suite so it will work on virtual hosting environments where localhost doesn’t resolve to 127.0.0.1 but the actual IP address of the host.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-126">MODPYTHON-126</a>) When Python*Handler or Python*Filter directive is used inside of a Files directive container, the handler/filter directory value will now correctly resolve to the directory corresponding to any parent Directory directive or the location of the .htaccess file the Files directive is contained in.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-133">MODPYTHON-133</a>) The table object returned by req.server.get_config() was not being populated correctly to be the state of directives set at global scope for the server.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-134">MODPYTHON-134</a>) Setting PythonDebug to Off, wasn’t overriding On setting in parent scope.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-140">MODPYTHON-140</a>) The util.redirect() function should be returning server status of apache.DONE and not apache.OK otherwise it will not give desired result if used in non content handler phase or where there are stacked content handlers.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-147">MODPYTHON-147</a>) Stopped directories being added to sys.path multiple times when PythonImport and PythonPath directive used.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-148">MODPYTHON-148</a>) Added missing Apache contants apache.PROXYREQ_RESPONSE and apache.HTTP_UPGRADE_REQUIRED. Also added new constants for Apache magic mime types and values for interpreting the req.connection.keepalive and req.read_body members.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-150">MODPYTHON-150</a>) In a multithread MPM, the apache.init() function could be called more than once for a specific interpreter instance whereas it should only be called once.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-151">MODPYTHON-151</a>) Debug error page returned to client when an exception in a handler occurred wasn’t escaping special HTML characters in the traceback or the details of the exception.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-157">MODPYTHON-157</a>) Wrong interpreter name used for fixup handler phase and earlier, when PythonInterpPerDirectory was enabled and request was against a directory but client didn’t provide the trailing slash.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-159">MODPYTHON-159</a>) Fix FieldStorage class so that it can handle multiline headers.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-160">MODPYTHON-160</a>) Using PythonInterpPerDirective when setting content handler to run dynamically with req.add_handler() would cause Apache to crash.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-161">MODPYTHON-161</a>) Directory argument supplied to req.add_handler() is canonicalized and a trailing slash added automatically. This is needed to ensure that the directory is always in POSIX path style as used by Apache and that convention where directories associated with directives always have trailing slash is adhered to. If this is not done, a different interpreter can be chosen to that expected when the PythonInterpPerDirective is used.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-166">MODPYTHON-166</a>) PythonHandlerModule was not setting up registration of the PythonFixupHandler or PythonAuthenHandler. For the latter this meant that using Require directive with PythonHandlerModule would cause a 500 error and complaint in error log about “No groups file”.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-167">MODPYTHON-167</a>) When PythonDebug was On and and exception occurred, the response to the client had a status of 200 when it really should have been a 500 error status indicating that an internal error occurred. A 500 error status was correctly being returned when PythonDebug was Off.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-168">MODPYTHON-168</a>) Fixed psp_parser error when CR is used as a line terminator in psp code. This may occur with some older editors such as GoLive on Mac OS X.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-175">MODPYTHON-175</a>) Fixed problem whereby a main PSP page and an error page triggered from that page both accessing the session object would cause a deadlock.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-176">MODPYTHON-176</a>) Fixed issue whereby PSP code would unlock session object which it had inherited from the caller meaning caller could no longer use it safely. PSP code will now only unlock session if it created it in the first place.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-179">MODPYTHON-179</a>) Fixed the behaviour of req.readlines() when a size hint was provided. Previously, it would always return a single line when a size hint was provided.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-180">MODPYTHON-180</a>) Publisher would wrongly output a warning about nothing to publish if req.write() or req.sendfile() used and data not flushed, and then published function returned None.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-181">MODPYTHON-181</a>) Fixed memory leak when mod_python handlers are defined for more than one phase at the same time.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-182">MODPYTHON-182</a>) Fixed memory leak in req.readline().</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-184">MODPYTHON-184</a>) Fix memory leak in apache.make_table(). This was used by util.FieldStorage class so affected all code using forms.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-185">MODPYTHON-185</a>) Fixed segfault in psp.parsestring(src_string) when src_string is empty.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-187">MODPYTHON-187</a>) Table objects could crash in various ways when the value of an item was NULL. This could occur for SCRIPT_FILENAME when the req.subprocess_env table was accessed in the post read request handler phase.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-189">MODPYTHON-189</a>) Fixed representation returned by calling repr() on a table object.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-191">MODPYTHON-191</a>) Session class will no longer accept a normal cookie if a signed cookie was expected.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-194">MODPYTHON-194</a>) Fixed potential memory leak due to not clearing the state of thread state objects before deleting them.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-195">MODPYTHON-195</a>) Fix potential Win32 resource leaks in parent Apache process when process restarts occur.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-198">MODPYTHON-198</a>) Python 2.5 broke nested __auth__/__access__/__auth_realm__ in mod_python.publisher.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-200">MODPYTHON-200</a>) Fixed problem whereby signed and marshalled cookies could not be used at the same time. When expecting marshalled cookie, any signed, but not marshalled cookies will be returned as normal cookies.</li> -</ul> -</div> -</div> -<div class="section" id="changes-from-version-3-2-8"> -<span id="changes-from-3-2-8"></span><h2>Changes from version 3.2.8<a class="headerlink" href="#changes-from-version-3-2-8" title="Permalink to this headline">¶</a></h2> -<div class="section" id="id7"> -<h3>New Features<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-78">MODPYTHON-78</a>) Added support for Apache 2.2.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-94">MODPYTHON-94</a>) New req.is_https() and req.ssl_var_lookup() methods. These communicate direct with the Apache mod_ssl module, allowing it to be determined if the connection is using SSL/TLS and what the values of internal ssl variables are.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-131">MODPYTHON-131</a>) The directory used for mutex locks can now be specified at at compile time using ./configure –with-mutex-dir value or at run time with PythonOption mod_python.mutex_directory value.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-137">MODPYTHON-137</a>) New req.server.get_options() method. This returns the subset of Python options set at global scope within the Apache configuration. That is, outside of the context of any VirtualHost, Location, Directory or Files directives.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-145">MODPYTHON-145</a>) The number of mutex locks can now be specified at run time with PythonOption mod_python.mutex_locks value.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-172">MODPYTHON-172</a>) Fixed three memory leaks that were found in _apachemodule.parse_qsl, req.readlines and util.cfgtree_walk.</li> -</ul> -</div> -<div class="section" id="id8"> -<h3>Improvements<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-77">MODPYTHON-77</a>) Third party C modules that use the simplified API for the Global Interpreter Lock (GIL), as described in PEP 311, can now be used. The only requirement is that such modules can only be used in the context of the “main_interpreter”.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-119">MODPYTHON-119</a>) DbmSession unit test no longer uses the default directory for the dbm file, so the test will not interfer with the user’s current apache instance.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-158">MODPYTHON-158</a>) Added additional debugging and logging output for where mod_python cannot initialise itself properly due to Python or mod_python version mismatches or missing Python module code files.</li> -</ul> -</div> -<div class="section" id="id9"> -<h3>Bug Fixes<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-84">MODPYTHON-84</a>) Fixed request.sendfile() bug for symlinked files on Win32.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-122">MODPYTHON-122</a>) Fixed configure problem when using bash 3.1.x.</li> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-173">MODPYTHON-173</a>) Fixed DbmSession to create db file with mode 0640.</li> -</ul> -</div> -</div> -<div class="section" id="changes-from-version-3-2-7"> -<span id="changes-from-3-2-7"></span><h2>Changes from version 3.2.7<a class="headerlink" href="#changes-from-version-3-2-7" title="Permalink to this headline">¶</a></h2> -<div class="section" id="security-fix"> -<h3>Security Fix<a class="headerlink" href="#security-fix" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>(<a class="reference external" href="http://issues.apache.org/jira/browse/MODPYTHON-135">MODPYTHON-135</a>) Fixed possible directory traversal attack in FileSession. The session id is now checked to ensure it only contains valid characters. This check is performed for all sessions derived from the BaseSession class.</li> -</ul> -</div> -</div> -<div class="section" id="changes-from-version-3-1-4"> -<span id="changes-from-3-1-4"></span><h2>Changes from version 3.1.4<a class="headerlink" href="#changes-from-version-3-1-4" title="Permalink to this headline">¶</a></h2> -<div class="section" id="id11"> -<h3>New Features<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>New apache.register_cleanup() method.</li> -<li>New apache.exists_config_define() method.</li> -<li>New file-based session manager class.</li> -<li>Session cookie name can be specified.</li> -<li>The maximum number of mutexes mod_python uses for session locking can now be specifed at compile time using configure –with-max-locks.</li> -<li>New a version attribute in mod_python module.</li> -<li>New test handler testhandler.py has been added.</li> -</ul> -</div> -<div class="section" id="id12"> -<h3>Improvements<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>Autoreload of a module using apache.import_module() now works if modification time for the module is different from the file. Previously, the module was only reloaded if the the modification time of the file was more recent. This allows for a more graceful reload if a file with an older modification time needs to be restored from backup.</li> -<li>Fixed the publisher traversal security issue</li> -<li>Objects hierarchy a la CherryPy can now be published.</li> -<li>mod_python.c now logs reason for a 500 error</li> -<li>Calls to PyErr_Print in mod_python.c are now followed by fflush()</li> -<li>Using an empty value with PythonOption will unset a PythonOption key.</li> -<li>req.path_info is now a read/write member.</li> -<li>Improvements to FieldStorage allow uploading of large files. Uploaded files are now streamed to disk, not to memory.</li> -<li>Path to flex is now discovered at configuration time or can be specifed using configure –with-flex=/path/to/flex.</li> -<li>sys.argv is now initialized to [“mod_python”] so that modules like numarray and pychart can work properly.</li> -</ul> -</div> -<div class="section" id="id13"> -<h3>Bug Fixes<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> -<ul class="simple"> -<li>Fixed memory leak which resulted from circular references starting from the request object.</li> -<li>Fixed memory leak resulting from multiple PythonOption directives.</li> -<li>Fixed Multiple/redundant interpreter creation problem.</li> -<li>Cookie attributes with attribute names prefixed with $ are now ignored. See Section 4.7 for more information.</li> -<li>Bug in setting up of config_dir from Handler directives fixed.</li> -<li>mod_python.publisher will now support modules with the same name but in different directories</li> -<li>Fixed continual reloading of modules problem</li> -<li>Fixed big marshalled cookies error.</li> -<li>Fixed mod_python.publisher extension handling</li> -<li>mod_python.publisher default index file traversal</li> -<li>mod_python.publisher loading wrong module and giving no warning/error</li> -<li>apply_fs_data() now works with “new style” objects</li> -<li>File descriptor fd closed after ap_send_fd() in req_sendfile()</li> -<li>Bug in mem_cleanup in MemorySession fixed.</li> -<li>Fixed bug in _apache._global_lock() which could cause a segfault if the lock index parameter is greater number of mutexes created at mod_python startup.</li> -<li>Fixed bug where local_ip and local_host in connection object were returning remote_ip and remote_host instead</li> -<li>Fixed install_dso Makefile rule so it only installs the dso, not the python files</li> -<li>Potential deadlock in psp cache handling fixed</li> -<li>Fixed bug where sessions are used outside <Directory> directive.</li> -<li>Fixed compile problem on IRIX. ln -s requires both TARGET and LINK_NAME on IRIX. ie. ln -s TARGET LINK_NAME</li> -<li>Fixed ./configure problem on SuSE Linux 9.2 (x86-64). Python libraries are in lib64/ for this platform.</li> -<li>Fixed req.sendfile() problem where sendfile(filename) sends the incorrect number of bytes when filename is a symlink.</li> -<li>Fixed problem where util.FieldStorage was not correctly checking the mime types of POSTed entities</li> -<li>Fixed conn.local_addr and conn.remote_addr for a better IPv6 support.</li> -<li>Fixed psp_parser.l to properly escape backslash-n, backslash-t and backslash-r character sequences.</li> -<li>Fixed segfault bug when accessing some request object members (allowed_methods, allowed_xmethods, content_languages) and some server object members (names, wild_names).</li> -<li>Fixed request.add_handler() segfault bug when adding a handler to an empty handler list.</li> -<li>Fixed PythonAutoReload directive so that AutoReload can be turned off.</li> -<li>Fixed connection object read() bug on FreeBSD.</li> -<li>Fixed potential buffer corruption bug in connection object read().</li> -</ul> -</div> -</div> -<div class="section" id="changes-from-version-2-x"> -<span id="changes-from-2-x"></span><h2>Changes from version 2.x<a class="headerlink" href="#changes-from-version-2-x" title="Permalink to this headline">¶</a></h2> -<ul class="simple"> -<li>Mod_python 3.0 no longer works with Apache 1.3, only Apache 2.x is supported.</li> -<li>Mod_python no longer works with Python versions less than 2.2.1</li> -<li>Mod_python now supports Apache filters.</li> -<li>Mod_python now supports Apache connection handlers.</li> -<li>Request object supports internal_redirect().</li> -<li>Connection object has read(), readline() and write().</li> -<li>Server object has get_config().</li> -<li>Httpdapi handler has been deprecated.</li> -<li>Zpublisher handler has been deprecated.</li> -<li>Username is now in req.user instead of req.connection.user</li> -</ul> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Changes</a><ul> -<li><a class="reference internal" href="#changes-from-version-3-4-1">Changes from version 3.4.1</a><ul> -<li><a class="reference internal" href="#new-features">New Features</a></li> -<li><a class="reference internal" href="#improvements">Improvements</a></li> -</ul> -</li> -<li><a class="reference internal" href="#changes-from-version-3-3-1">Changes from version 3.3.1</a><ul> -<li><a class="reference internal" href="#id2">New Features</a></li> -<li><a class="reference internal" href="#id3">Improvements</a></li> -<li><a class="reference internal" href="#bug-fixes">Bug Fixes</a></li> -</ul> -</li> -<li><a class="reference internal" href="#changes-from-version-3-2-10">Changes from version 3.2.10</a><ul> -<li><a class="reference internal" href="#id4">New Features</a></li> -<li><a class="reference internal" href="#id5">Improvements</a></li> -<li><a class="reference internal" href="#id6">Bug Fixes</a></li> -</ul> -</li> -<li><a class="reference internal" href="#changes-from-version-3-2-8">Changes from version 3.2.8</a><ul> -<li><a class="reference internal" href="#id7">New Features</a></li> -<li><a class="reference internal" href="#id8">Improvements</a></li> -<li><a class="reference internal" href="#id9">Bug Fixes</a></li> -</ul> -</li> -<li><a class="reference internal" href="#changes-from-version-3-2-7">Changes from version 3.2.7</a><ul> -<li><a class="reference internal" href="#security-fix">Security Fix</a></li> -</ul> -</li> -<li><a class="reference internal" href="#changes-from-version-3-1-4">Changes from version 3.1.4</a><ul> -<li><a class="reference internal" href="#id11">New Features</a></li> -<li><a class="reference internal" href="#id12">Improvements</a></li> -<li><a class="reference internal" href="#id13">Bug Fixes</a></li> -</ul> -</li> -<li><a class="reference internal" href="#changes-from-version-2-x">Changes from version 2.x</a></li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="ssi.html" - title="previous chapter">Server Side Includes</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="license.html" - title="next chapter">History and License</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/changes.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="license.html" title="History and License" - >next</a> |</li> - <li class="right" > - <a href="ssi.html" title="Server Side Includes" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/commandline.html b/doc-html/commandline.html deleted file mode 100644 index 5a5281e5d8f1bf8f4602a57a18397008bfaeffa5..0000000000000000000000000000000000000000 --- a/doc-html/commandline.html +++ /dev/null @@ -1,250 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Command Line Tool - mod_python — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Server Side Includes" href="ssi.html" /> - <link rel="prev" title="Standard Handlers" href="handlers.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="ssi.html" title="Server Side Includes" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="handlers.html" title="Standard Handlers" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="command-line-tool-mod-python"> -<span id="cmd"></span><h1>Command Line Tool - mod_python<a class="headerlink" href="#command-line-tool-mod-python" title="Permalink to this headline">¶</a></h1> -<div class="section" id="overview-of-mod-python-command"> -<span id="cmd-overview"></span><h2>Overview of mod_python command<a class="headerlink" href="#overview-of-mod-python-command" title="Permalink to this headline">¶</a></h2> -<p>mod_python includes a command-line tool named <tt class="docutils literal"><span class="pre">mod_python</span></tt>. The -<tt class="docutils literal"><span class="pre">mod_python</span></tt> command exists to facilitate tasks related to -configuration and management of mod_python.</p> -<p>The general syntax for the command is <tt class="docutils literal"><span class="pre">mod_python</span> <span class="pre"><subcommand></span> <span class="pre"><arguments></span></tt> -where <tt class="docutils literal"><span class="pre"><subcommand></span></tt> is a separate tool with its own argument requirements.</p> -</div> -<div class="section" id="mod-python-command-line-tool-sub-commands"> -<span id="cmd-subcommands"></span><h2>mod_python command line tool sub-commands<a class="headerlink" href="#mod-python-command-line-tool-sub-commands" title="Permalink to this headline">¶</a></h2> -<div class="section" id="create"> -<h3>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h3> -<p><tt class="docutils literal"><span class="pre">create</span></tt> sub-command creates a simple Apache configuration and a -skeleton directory structure necessary for placement of configuration, -logs and content. It is meant to be executed only once per lifetime of -a project.</p> -<p>The configuration generated by <tt class="docutils literal"><span class="pre">create</span></tt> consists of an -<a class="reference internal" href="pythonapi.html#module-httpdconf" title="httpdconf: HTTPd Configuration"><tt class="xref py py-mod docutils literal"><span class="pre">httpdconf</span></tt></a> based version (in Python) which can then be used to -generate an actual Apache configuration (by using the <tt class="docutils literal"><span class="pre">genconfig</span></tt> -subcommand or simply executing the config files itself). The idea is -that the Apache configuration is always generated and the Python -version is the one meant for editing/adjustments.</p> -<p>The <tt class="docutils literal"><span class="pre">create</span></tt> subcommand will create the necessary files and -directories if they do not exist, but will not overwrite any existing -files or directories only producing a warning when a file or directory -already exists. It will abort if the Python version of the -configuration file already exists.</p> -<p><tt class="docutils literal"><span class="pre">create</span></tt> requires a single argument: the distination directory, -Apache <tt class="docutils literal"><span class="pre">ServerRoot</span></tt>.</p> -<p><tt class="docutils literal"><span class="pre">create</span></tt> has the following command options:</p> -<dl class="cmdoption"> -<dt id="cmdoption--listen"> -<tt class="descname">--listen</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption--listen" title="Permalink to this definition">¶</a></dt> -<dd><p>A string describing the port and optional IP address on which the -server is to listen for incoming requests in the form -<tt class="docutils literal"><span class="pre">[ip_address:]port</span></tt> The argument will be applied to the Apache -<tt class="docutils literal"><span class="pre">Listen</span></tt> directive as is and therefore must be syntactically -compatible with it.</p> -</dd></dl> - -<dl class="cmdoption"> -<dt id="cmdoption--pythonpath"> -<tt class="descname">--pythonpath</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption--pythonpath" title="Permalink to this definition">¶</a></dt> -<dd><p>A colon (<tt class="docutils literal"><span class="pre">":"</span></tt>) separate list of paths to be applied to the -<a class="reference internal" href="directives.html#dir-other-pp"><em>PythonPath</em></a> directive.</p> -</dd></dl> - -<dl class="cmdoption"> -<dt id="cmdoption--pythonhandler"> -<tt class="descname">--pythonhandler</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption--pythonhandler" title="Permalink to this definition">¶</a></dt> -<dd><p>The name of the Python handler to use. Applied to the -<a class="reference internal" href="directives.html#dir-handlers-ph"><em>PythonHandler</em></a> directive.</p> -</dd></dl> - -<dl class="cmdoption"> -<dt id="cmdoption--pythonoption"> -<tt class="descname">--pythonoption</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption--pythonoption" title="Permalink to this definition">¶</a></dt> -<dd><p>An option to be specified in the configuration. Multiple options -are alowed. Applied to the <a class="reference internal" href="directives.html#dir-other-po"><em>PythonOption</em></a> directive.</p> -</dd></dl> - -</div> -<div class="section" id="genconfig"> -<span id="cmd-sub-create-example"></span><h3>genconfig<a class="headerlink" href="#genconfig" title="Permalink to this headline">¶</a></h3> -<p>This sub-command exists to facilitate re-generation of an Apache -configuration from a Python-based one. All it does is run the script, -but its use is recommended because the mod_python command will execute -the correct version of Python under which mod_python was initially -compiled. Example:</p> -<div class="highlight-python"><pre>mod_python genconfig /path/to/server_root/httpd_conf.py > /path/to/server_root/httpd.conf</pre> -</div> -</div> -<div class="section" id="start"> -<h3>start<a class="headerlink" href="#start" title="Permalink to this headline">¶</a></h3> -<p>Starts an Apache instance. Requires a single argument, the path to -Apache configuration file.</p> -</div> -<div class="section" id="stop"> -<h3>stop<a class="headerlink" href="#stop" title="Permalink to this headline">¶</a></h3> -<p>Stops an Apache instance (using graceful-stop). Requires a single -argument, the path to Apache configuration file.</p> -</div> -<div class="section" id="restart"> -<h3>restart<a class="headerlink" href="#restart" title="Permalink to this headline">¶</a></h3> -<p>Stops an Apache instance (using graceful). Requires a single argument, -the path to Apache configuration file.</p> -</div> -<div class="section" id="version"> -<h3>version<a class="headerlink" href="#version" title="Permalink to this headline">¶</a></h3> -<p>This sub-command prints out version and location information about -this mod_python installation, the Apache HTTP Server and Python used -when building this mod_python instance.</p> -</div> -<div class="section" id="example"> -<h3>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h3> -<p>To create an Apache instance with all the required directories for a -WSGI application which is located in <tt class="docutils literal"><span class="pre">/path/to/myapp</span></tt> and defined in -<tt class="docutils literal"><span class="pre">/path/to/myapp/myapp/myapp/wsgi.py</span></tt>, run the following:</p> -<div class="highlight-python"><pre>mod_python create /path/to/new/server_root \ - --pythonpath=/path/to/my/app \ - --pythonhandler=mod_python.wsgi \ - --pythonoption="mod_python.wsgi.application myapp.wsgi::application"</pre> -</div> -<p>The above example will create a Python-based configuration in -<tt class="docutils literal"><span class="pre">/path/to/new/server_root/conf/http_conf.py</span></tt> which is a simple -Pythong script. When executed, the output of the script becomes an -Apache configuration (<tt class="docutils literal"><span class="pre">create</span></tt> will take care of generating the -first Apache config for you).</p> -<p>You should be able to run this Apache instance by executing:</p> -<div class="highlight-python"><pre>mod_python start /path/to/new/server_root/conf/httpd.conf</pre> -</div> -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Command Line Tool - mod_python</a><ul> -<li><a class="reference internal" href="#overview-of-mod-python-command">Overview of mod_python command</a></li> -<li><a class="reference internal" href="#mod-python-command-line-tool-sub-commands">mod_python command line tool sub-commands</a><ul> -<li><a class="reference internal" href="#create">create</a></li> -<li><a class="reference internal" href="#genconfig">genconfig</a></li> -<li><a class="reference internal" href="#start">start</a></li> -<li><a class="reference internal" href="#stop">stop</a></li> -<li><a class="reference internal" href="#restart">restart</a></li> -<li><a class="reference internal" href="#version">version</a></li> -<li><a class="reference internal" href="#example">Example</a></li> -</ul> -</li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="handlers.html" - title="previous chapter">Standard Handlers</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="ssi.html" - title="next chapter">Server Side Includes</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/commandline.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="ssi.html" title="Server Side Includes" - >next</a> |</li> - <li class="right" > - <a href="handlers.html" title="Standard Handlers" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/contents.html b/doc-html/contents.html deleted file mode 100644 index c1dabb03dca349d2c2d1bff45c8af6a0c1c13b96..0000000000000000000000000000000000000000 --- a/doc-html/contents.html +++ /dev/null @@ -1,345 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Mod_python Documentation — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Introduction" href="introduction.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="introduction.html" title="Introduction" - accesskey="N">next</a> |</li> - <li><a href="#">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="mod-python-documentation"> -<h1>Mod_python Documentation<a class="headerlink" href="#mod-python-documentation" title="Permalink to this headline">¶</a></h1> -<p>This document aims to be the only necessary and authoritative source -of information about mod_python, usable as a comprehensive reference, -a user guide and a tutorial all-in-one.</p> -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><a class="reference external" href="http://www.python.org/">Python Language Web Site</a></dt> -<dd>for information on the Python language</dd> -<dt><a class="reference external" href="http://httpd.apache.org/">Apache HTTP Server Project Web Site</a></dt> -<dd>for information on the Apache server</dd> -</dl> -</div> -<div class="toctree-wrapper compound"> -<ul> -<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a><ul> -<li class="toctree-l2"><a class="reference internal" href="introduction.html#performance">Performance</a></li> -<li class="toctree-l2"><a class="reference internal" href="introduction.html#apache-http-server-api">Apache HTTP Server API</a></li> -<li class="toctree-l2"><a class="reference internal" href="introduction.html#other-features">Other Features</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a><ul> -<li class="toctree-l2"><a class="reference internal" href="installation.html#prerequisites">Prerequisites</a></li> -<li class="toctree-l2"><a class="reference internal" href="installation.html#compiling">Compiling</a><ul> -<li class="toctree-l3"><a class="reference internal" href="installation.html#running-configure">Running <tt class="file docutils literal"><span class="pre">./configure</span></tt></a></li> -<li class="toctree-l3"><a class="reference internal" href="installation.html#running-make">Running <tt class="file docutils literal"><span class="pre">make</span></tt></a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="installation.html#installing">Installing</a></li> -<li class="toctree-l2"><a class="reference internal" href="installation.html#configuring-apache">Configuring Apache</a></li> -<li class="toctree-l2"><a class="reference internal" href="installation.html#testing">Testing</a></li> -<li class="toctree-l2"><a class="reference internal" href="installation.html#troubleshooting">Troubleshooting</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a><ul> -<li class="toctree-l2"><a class="reference internal" href="tutorial.html#a-quick-start-with-the-publisher-handler">A Quick Start with the Publisher Handler</a></li> -<li class="toctree-l2"><a class="reference internal" href="tutorial.html#quick-overview-of-how-apache-handles-requests">Quick Overview of how Apache Handles Requests</a></li> -<li class="toctree-l2"><a class="reference internal" href="tutorial.html#so-what-exactly-does-mod-python-do">So what Exactly does Mod-python do?</a></li> -<li class="toctree-l2"><a class="reference internal" href="tutorial.html#now-something-more-complicated-authentication">Now something More Complicated - Authentication</a></li> -<li class="toctree-l2"><a class="reference internal" href="tutorial.html#your-own-404-handler">Your Own 404 Handler</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="pythonapi.html">Python API</a><ul> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#multiple-interpreters">Multiple Interpreters</a></li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#overview-of-a-request-handler">Overview of a Request Handler</a></li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#overview-of-a-filter-handler">Overview of a Filter Handler</a></li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#overview-of-a-connection-handler">Overview of a Connection Handler</a></li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#module-apache"><tt class="docutils literal"><span class="pre">apache</span></tt> – Access to Apache Internals.</a><ul> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#functions">Functions</a></li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#attributes">Attributes</a></li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#table-object-mp-table">Table Object (mp_table)</a></li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#request-object">Request Object</a><ul> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#request-methods">Request Methods</a></li> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#request-members">Request Members</a></li> -</ul> -</li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#connection-object-mp-conn">Connection Object (mp_conn)</a><ul> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#connection-methods">Connection Methods</a></li> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#connection-members">Connection Members</a></li> -</ul> -</li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#filter-object-mp-filter">Filter Object (mp_filter)</a><ul> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#filter-methods">Filter Methods</a></li> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#filter-members">Filter Members</a></li> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#server-object-mp-server">Server Object (mp_server)</a></li> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#server-methods">Server Methods</a></li> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#server-members">Server Members</a></li> -</ul> -</li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#module-util"><tt class="docutils literal"><span class="pre">util</span></tt> – Miscellaneous Utilities</a><ul> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#fieldstorage-class">FieldStorage class</a><ul> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#fieldstorage-methods"><tt class="docutils literal"><span class="pre">FieldStorage</span></tt> methods</a></li> -</ul> -</li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#fieldstorage-examples">FieldStorage Examples</a><ul> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#simple-file-control-using-class-constructor">Simple file control using class constructor</a></li> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#advanced-file-control-using-object-factory">Advanced file control using object factory</a></li> -</ul> -</li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#field-class">Field class</a></li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#other-functions">Other functions</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#module-Cookie"><tt class="docutils literal"><span class="pre">Cookie</span></tt> – HTTP State Management</a><ul> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#classes">Classes</a><ul> -<li class="toctree-l4"><a class="reference internal" href="pythonapi.html#pyapi-cookie-func">Functions</a></li> -</ul> -</li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#examples">Examples</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#module-Session"><tt class="docutils literal"><span class="pre">Session</span></tt> – Session Management</a><ul> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#pyapi-sess-classes">Classes</a></li> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#pyapi-sess-example">Examples</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#module-psp"><tt class="docutils literal"><span class="pre">psp</span></tt> – Python Server Pager</a></li> -<li class="toctree-l2"><a class="reference internal" href="pythonapi.html#module-httpdconf"><tt class="docutils literal"><span class="pre">httpdconf</span></tt> – HTTPd Configuration</a><ul> -<li class="toctree-l3"><a class="reference internal" href="pythonapi.html#classes-for-directive-types">Classes for Directive types</a></li> -</ul> -</li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="directives.html">Apache Configuration Directives</a><ul> -<li class="toctree-l2"><a class="reference internal" href="directives.html#request-handlers">Request Handlers</a><ul> -<li class="toctree-l3"><a class="reference internal" href="directives.html#python-handler-directive-syntax">Python*Handler Directive Syntax</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#python-handlers-and-python-path">Python*Handlers and Python path</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonpostreadrequesthandler">PythonPostReadRequestHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythontranshandler">PythonTransHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonheaderparserhandler">PythonHeaderParserHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythoninithandler">PythonInitHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonaccesshandler">PythonAccessHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonauthenhandler">PythonAuthenHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonauthzhandler">PythonAuthzHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythontypehandler">PythonTypeHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonfixuphandler">PythonFixupHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonhandler">PythonHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonloghandler">PythonLogHandler</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythoncleanuphandler">PythonCleanupHandler</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="directives.html#filters">Filters</a><ul> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythoninputfilter">PythonInputFilter</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonoutputfilter">PythonOutputFilter</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="directives.html#connection-handler">Connection Handler</a><ul> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonconnectionhandler">PythonConnectionHandler</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="directives.html#other-directives">Other Directives</a><ul> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonenablepdb">PythonEnablePdb</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythondebug">PythonDebug</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonimport">PythonImport</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythoninterpperdirectory">PythonInterpPerDirectory</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythoninterpperdirective">PythonInterpPerDirective</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythoninterpreter">PythonInterpreter</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonhandlermodule">PythonHandlerModule</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonautoreload">PythonAutoReload</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonoptimize">PythonOptimize</a></li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonoption">PythonOption</a><ul> -<li class="toctree-l4"><a class="reference internal" href="directives.html#reserved-pythonoption-keywords">Reserved PythonOption Keywords</a></li> -</ul> -</li> -<li class="toctree-l3"><a class="reference internal" href="directives.html#pythonpath">PythonPath</a></li> -</ul> -</li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="handlers.html">Standard Handlers</a><ul> -<li class="toctree-l2"><a class="reference internal" href="handlers.html#publisher-handler">Publisher Handler</a><ul> -<li class="toctree-l3"><a class="reference internal" href="handlers.html#introduction">Introduction</a></li> -<li class="toctree-l3"><a class="reference internal" href="handlers.html#the-publishing-algorithm">The Publishing Algorithm</a><ul> -<li class="toctree-l4"><a class="reference internal" href="handlers.html#traversal">Traversal</a></li> -<li class="toctree-l4"><a class="reference internal" href="handlers.html#argument-matching-and-invocation">Argument Matching and Invocation</a></li> -<li class="toctree-l4"><a class="reference internal" href="handlers.html#authentication">Authentication</a></li> -</ul> -</li> -<li class="toctree-l3"><a class="reference internal" href="handlers.html#form-data">Form Data</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="handlers.html#wsgi-handler">WSGI Handler</a></li> -<li class="toctree-l2"><a class="reference internal" href="handlers.html#psp-handler">PSP Handler</a></li> -<li class="toctree-l2"><a class="reference internal" href="handlers.html#cgi-handler">CGI Handler</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="commandline.html">Command Line Tool - mod_python</a><ul> -<li class="toctree-l2"><a class="reference internal" href="commandline.html#overview-of-mod-python-command">Overview of mod_python command</a></li> -<li class="toctree-l2"><a class="reference internal" href="commandline.html#mod-python-command-line-tool-sub-commands">mod_python command line tool sub-commands</a><ul> -<li class="toctree-l3"><a class="reference internal" href="commandline.html#create">create</a></li> -<li class="toctree-l3"><a class="reference internal" href="commandline.html#genconfig">genconfig</a></li> -<li class="toctree-l3"><a class="reference internal" href="commandline.html#start">start</a></li> -<li class="toctree-l3"><a class="reference internal" href="commandline.html#stop">stop</a></li> -<li class="toctree-l3"><a class="reference internal" href="commandline.html#restart">restart</a></li> -<li class="toctree-l3"><a class="reference internal" href="commandline.html#version">version</a></li> -<li class="toctree-l3"><a class="reference internal" href="commandline.html#example">Example</a></li> -</ul> -</li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="ssi.html">Server Side Includes</a><ul> -<li class="toctree-l2"><a class="reference internal" href="ssi.html#overview-of-ssi">Overview of SSI</a></li> -<li class="toctree-l2"><a class="reference internal" href="ssi.html#using-python-code">Using Python Code</a></li> -<li class="toctree-l2"><a class="reference internal" href="ssi.html#scope-of-global-data">Scope of Global Data</a></li> -<li class="toctree-l2"><a class="reference internal" href="ssi.html#pre-populating-globals">Pre-populating Globals</a></li> -<li class="toctree-l2"><a class="reference internal" href="ssi.html#conditional-expressions">Conditional Expressions</a></li> -<li class="toctree-l2"><a class="reference internal" href="ssi.html#enabling-includes-filter">Enabling INCLUDES Filter</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="changes.html">Changes</a><ul> -<li class="toctree-l2"><a class="reference internal" href="changes.html#changes-from-version-3-4-1">Changes from version 3.4.1</a><ul> -<li class="toctree-l3"><a class="reference internal" href="changes.html#new-features">New Features</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#improvements">Improvements</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#changes-from-version-3-3-1">Changes from version 3.3.1</a><ul> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id2">New Features</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id3">Improvements</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#bug-fixes">Bug Fixes</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#changes-from-version-3-2-10">Changes from version 3.2.10</a><ul> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id4">New Features</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id5">Improvements</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id6">Bug Fixes</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#changes-from-version-3-2-8">Changes from version 3.2.8</a><ul> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id7">New Features</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id8">Improvements</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id9">Bug Fixes</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#changes-from-version-3-2-7">Changes from version 3.2.7</a><ul> -<li class="toctree-l3"><a class="reference internal" href="changes.html#security-fix">Security Fix</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#changes-from-version-3-1-4">Changes from version 3.1.4</a><ul> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id11">New Features</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id12">Improvements</a></li> -<li class="toctree-l3"><a class="reference internal" href="changes.html#id13">Bug Fixes</a></li> -</ul> -</li> -<li class="toctree-l2"><a class="reference internal" href="changes.html#changes-from-version-2-x">Changes from version 2.x</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="license.html">History and License</a><ul> -<li class="toctree-l2"><a class="reference internal" href="license.html#history">History</a></li> -<li class="toctree-l2"><a class="reference internal" href="license.html#license">License</a></li> -</ul> -</li> -<li class="toctree-l1"><a class="reference internal" href="about.html">About these documents</a></li> -<li class="toctree-l1"><a class="reference internal" href="copyright.html">Copyright</a></li> -</ul> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Next topic</h4> - <p class="topless"><a href="introduction.html" - title="next chapter">Introduction</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/contents.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="introduction.html" title="Introduction" - >next</a> |</li> - <li><a href="#">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/copyright.html b/doc-html/copyright.html deleted file mode 100644 index f96ec0118a9fbbd4e7065e4e106446480b9b6464..0000000000000000000000000000000000000000 --- a/doc-html/copyright.html +++ /dev/null @@ -1,114 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Copyright — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="#" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="prev" title="About these documents" href="about.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="about.html" title="About these documents" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="copyright"> -<h1>Copyright<a class="headerlink" href="#copyright" title="Permalink to this headline">¶</a></h1> -<p>Mod_python and this documentation is:</p> -<p>Copyright © 2000, 2001, 2013 Gregory Trubetskoy</p> -<p>Copyright © 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation</p> -<hr class="docutils" /> -<p>See <a class="reference internal" href="license.html#history-and-license"><em>History and License</em></a> for complete license and permissions information.</p> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Previous topic</h4> - <p class="topless"><a href="about.html" - title="previous chapter">About these documents</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/copyright.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="about.html" title="About these documents" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="#">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/directives.html b/doc-html/directives.html deleted file mode 100644 index 3a514a0ebbbf889e6edcddcccfd78fecc0df3d22..0000000000000000000000000000000000000000 --- a/doc-html/directives.html +++ /dev/null @@ -1,827 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Apache Configuration Directives — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Standard Handlers" href="handlers.html" /> - <link rel="prev" title="Python API" href="pythonapi.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="handlers.html" title="Standard Handlers" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="pythonapi.html" title="Python API" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="apache-configuration-directives"> -<span id="directives"></span><h1>Apache Configuration Directives<a class="headerlink" href="#apache-configuration-directives" title="Permalink to this headline">¶</a></h1> -<div class="section" id="request-handlers"> -<span id="dir-handlers"></span><h2>Request Handlers<a class="headerlink" href="#request-handlers" title="Permalink to this headline">¶</a></h2> -<div class="section" id="python-handler-directive-syntax"> -<span id="dir-handlers-syn"></span><h3>Python*Handler Directive Syntax<a class="headerlink" href="#python-handler-directive-syntax" title="Permalink to this headline">¶</a></h3> -<p id="index-0">All request handler directives have the following syntax:</p> -<p><tt class="docutils literal"><span class="pre">Python*Handler</span> <span class="pre">handler</span> <span class="pre">[handler</span> <span class="pre">...]</span> <span class="pre">[</span> <span class="pre">|</span> <span class="pre">.ext</span> <span class="pre">[.ext</span> <span class="pre">...]</span> <span class="pre">]</span></tt></p> -<p>Where <em>handler</em> is a callable object that accepts a single argument - -request object, and <em>.ext</em> is an optional file extension.</p> -<p>Multiple handlers can be specified on a single line, in which case -they will be called sequentially, from left to right. Same handler -directives can be specified multiple times as well, with the same -result - all handlers listed will be executed sequentially, from first -to last.</p> -<p>If any handler in the sequence returns a value other than -<tt class="docutils literal"><span class="pre">apache.OK</span></tt> or <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then execution of all subsequent -handlers for that phase is aborted. What happens when either -<tt class="docutils literal"><span class="pre">apache.OK</span></tt> or <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt> is returned is dependent on which -phase is executing.</p> -<p>Note that prior to mod_python 3.3, if any handler in the sequence, no -matter which phase was executing, returned a value other than -<tt class="docutils literal"><span class="pre">apache.OK</span></tt>, then execution of all subsequent handlers for that phase -was aborted.</p> -<p>The list of handlers can optionally be followed by a <tt class="docutils literal"><span class="pre">|</span></tt> followed -by one or more file extensions. This would restrict the execution of -the handler to those file extensions only. This feature only works for -handlers executed after the trans phase.</p> -<p>A <em>handler</em> has the following syntax:</p> -<p><tt class="docutils literal"><span class="pre">module[::object]</span></tt></p> -<p>Where <em>module</em> can be a full module name (package dot notation is -accepted) or an actual path to a module code file. The module is loaded -using the mod_python module importer as implemented by the -<tt class="docutils literal"><span class="pre">apache.import_module()</span></tt> function. Reference should be made to -the documentation of that function for further details of how module -importing is managed.</p> -<p>The optional <em>object</em> is the name of an object inside the module. -Object can also contain dots, in which case it will be resolved from -left to right. During resolution, if mod_python encounters an object -of type <tt class="docutils literal"><span class="pre"><class></span></tt>, it will try instantiating it passing it a single -argument, a request object.</p> -<p>If no object is specified, then it will default to the directive of -the handler, all lower case, with the word <tt class="docutils literal"><span class="pre">'python'</span></tt> -removed. E.g. the default object for PythonAuthenHandler would be -authenhandler.</p> -<p>Example:</p> -<div class="highlight-python"><pre>PythonAuthzHandler mypackage.mymodule::checkallowed</pre> -</div> -<p>For more information on handlers, see <a class="reference internal" href="pythonapi.html#pyapi-handler"><em>Overview of a Request Handler</em></a>.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">The <tt class="docutils literal"><span class="pre">'::'</span></tt> was chosen for performance reasons. In order -for Python to use objects inside modules, the modules first need to -be imported. Having the separator as simply a <tt class="docutils literal"><span class="pre">'.'</span></tt>, would -considerably complicate process of sequentially evaluating every -word to determine whether it is a package, module, class etc. Using -the (admittedly un-Python-like) <tt class="docutils literal"><span class="pre">'::'</span></tt> removes the time-consuming -work of figuring out where the module part ends and the object -inside of it begins, resulting in a modest performance gain.</p> -</div> -<p id="index-1">The handlers in this document are listed in order in which phases are -processed by Apache.</p> -</div> -<div class="section" id="python-handlers-and-python-path"> -<span id="dir-handlers-pp"></span><h3>Python*Handlers and Python path<a class="headerlink" href="#python-handlers-and-python-path" title="Permalink to this headline">¶</a></h3> -<p id="index-2">If a <tt class="docutils literal"><span class="pre">Python*Handler</span></tt> directive is specified in a <em>directory section</em> -(i.e. inside a <tt class="docutils literal"><span class="pre"><Directory></Directory></span></tt> or -<tt class="docutils literal"><span class="pre"><DirectoryMatch></DirectoryMatch></span></tt> or in an <tt class="docutils literal"><span class="pre">.htaccess</span></tt> file), -then this directory is automatically prepended to the Python path -(<tt class="docutils literal"><span class="pre">sys.path</span></tt>) <em>unless</em> Python path is specified explicitely with the -<tt class="docutils literal"><span class="pre">PythonPath</span></tt> directive.</p> -<p>If a <tt class="docutils literal"><span class="pre">Python*Handler</span></tt> directive is specified in a <em>location section</em> -(i.e. inside <tt class="docutils literal"><span class="pre"><Location></Location></span></tt> or -<tt class="docutils literal"><span class="pre"><LocationMatch></LocationMatch></span></tt>), then no path modification is done -automatically and in most cases a <tt class="docutils literal"><span class="pre">PythonPath</span></tt> directive is required -to augment the path so that the handler module can be imported.</p> -<p>Also for <tt class="docutils literal"><span class="pre">Python*Handlers</span></tt> inside a location section mod_python -disables the phase of the request that maps the URI to a file on the -filesystem (<tt class="docutils literal"><span class="pre">ap_hook_map_to_storage</span></tt>). This is because there is -usually no link between path specified in <tt class="docutils literal"><span class="pre"><Location></span></tt> and the -filesystem, while attempting to map to a filesystem location results -in unnecessary and expensive filesystem calls. Note that an important -side-effect of this is that once a request URI has been matched to a -<tt class="docutils literal"><span class="pre"><Location></span></tt> containing a mod_python handler, all <tt class="docutils literal"><span class="pre"><Directory></span></tt> -and <tt class="docutils literal"><span class="pre"><DirectoryMatch></span></tt> directives and their contents are ignored for -this request.</p> -</div> -<div class="section" id="pythonpostreadrequesthandler"> -<span id="dir-handlers-prrh"></span><h3>PythonPostReadRequestHandler<a class="headerlink" href="#pythonpostreadrequesthandler" title="Permalink to this headline">¶</a></h3> -<p id="index-3"><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This handler is called after the request has been read but before any -other phases have been processed. This is useful to make decisions -based upon the input header fields.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.OK</span></tt> or <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then -execution of all subsequent handlers for this phase is aborted.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">When this phase of the request is processed, the URI has not yet -been translated into a path name, therefore this directive could -never be executed by Apache if it could specified within -<tt class="docutils literal"><span class="pre"><Directory></span></tt>, <tt class="docutils literal"><span class="pre"><Location></span></tt>, <tt class="docutils literal"><span class="pre"><File></span></tt> directives or in an -<tt class="file docutils literal"><span class="pre">.htaccess</span></tt> file. The only place this directive is allowed is -the main configuration file, and the code for it will execute in -the main interpreter. And because this phase happens before any -identification of the type of content being requested is done -(i.e. is this a python program or a gif?), the python routine -specified with this handler will be called for <em>ALL</em> requests on -this server (not just python programs), which is an important -consideration if performance is a priority.</p> -</div> -</div> -<div class="section" id="pythontranshandler"> -<span id="dir-handlers-th"></span><h3>PythonTransHandler<a class="headerlink" href="#pythontranshandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This handler allows for an opportunity to translate the URI into -an actual filename, before the server’s default rules (Alias -directives and the like) are followed.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then execution of all -subsequent handlers for this phase is aborted.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">At the time when this phase of the request is being processed, the -URI has not been translated into a path name, therefore this -directive will never be executed by Apache if specified within -<tt class="docutils literal"><span class="pre"><Directory></span></tt>, <tt class="docutils literal"><span class="pre"><Location></span></tt>, <tt class="docutils literal"><span class="pre"><File></span></tt> directives or in an -<tt class="file docutils literal"><span class="pre">.htaccess</span></tt> file. The only place this can be specified is the -main configuration file, and the code for it will execute in the -main interpreter.</p> -</div> -</div> -<div class="section" id="pythonheaderparserhandler"> -<span id="dir-handlers-hph"></span><h3>PythonHeaderParserHandler<a class="headerlink" href="#pythonheaderparserhandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This handler is called to give the module a chance to look at the -request headers and take any appropriate specific actions early in the -processing sequence.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.OK</span></tt> or <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then -execution of all subsequent handlers for this phase is aborted.</p> -</div> -<div class="section" id="pythoninithandler"> -<span id="dir-handlers-pih"></span><h3>PythonInitHandler<a class="headerlink" href="#pythoninithandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This handler is the first handler called in the request processing -phases that is allowed both inside and outside :file`.htaccess` and -directory.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.OK</span></tt> or <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then -execution of all subsequent handlers for this phase is aborted.</p> -<p>This handler is actually an alias to two different handlers. When -specified in the main config file outside any directory tags, it is an -alias to <tt class="docutils literal"><span class="pre">PostReadRequestHandler</span></tt>. When specified inside directory -(where <tt class="docutils literal"><span class="pre">PostReadRequestHandler</span></tt> is not allowed), it aliases to -<tt class="docutils literal"><span class="pre">PythonHeaderParserHandler</span></tt>.</p> -<p>*(This idea was borrowed from mod_perl)</p> -</div> -<div class="section" id="pythonaccesshandler"> -<span id="dir-handlers-ach"></span><h3>PythonAccessHandler<a class="headerlink" href="#pythonaccesshandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This routine is called to check for any module-specific restrictions -placed upon the requested resource.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.OK</span></tt> or <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then -execution of all subsequent handlers for this phase is aborted.</p> -<p>For example, this can be used to restrict access by IP number. To do -so, you would return <tt class="docutils literal"><span class="pre">HTTP_FORBIDDEN</span></tt> or some such to indicate -that access is not allowed.</p> -</div> -<div class="section" id="pythonauthenhandler"> -<span id="dir-handlers-auh"></span><h3>PythonAuthenHandler<a class="headerlink" href="#pythonauthenhandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This routine is called to check the authentication information sent -with the request (such as looking up the user in a database and -verifying that the [encrypted] password sent matches the one in the -database).</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then execution of all -subsequent handlers for this phase is aborted.</p> -<p>To obtain the username, use <tt class="docutils literal"><span class="pre">req.user</span></tt>. To obtain the password -entered by the user, use the <tt class="xref py py-meth docutils literal"><span class="pre">request.get_basic_auth_pw()</span></tt> function.</p> -<p>A return of <tt class="docutils literal"><span class="pre">apache.OK</span></tt> means the authentication succeeded. A return -of <tt class="docutils literal"><span class="pre">apache.HTTP_UNAUTHORIZED</span></tt> with most browser will bring up the -password dialog box again. A return of <tt class="docutils literal"><span class="pre">apache.HTTP_FORBIDDEN</span></tt> will -usually show the error on the browser and not bring up the password -dialog <tt class="docutils literal"><span class="pre">again.</span> <span class="pre">HTTP_FORBIDDEN</span></tt> should be used when authentication -succeeded, but the user is not permitted to access a particular URL.</p> -<p>An example authentication handler might look like this:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">authenhandler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - - <span class="n">pw</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">get_basic_auth_pw</span><span class="p">()</span> - <span class="n">user</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">user</span> - <span class="k">if</span> <span class="n">user</span> <span class="o">==</span> <span class="s">"spam"</span> <span class="ow">and</span> <span class="n">pw</span> <span class="o">==</span> <span class="s">"eggs"</span><span class="p">:</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> - <span class="k">else</span><span class="p">:</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">HTTP_UNAUTHORIZED</span> -</pre></div> -</div> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last"><tt class="xref py py-meth docutils literal"><span class="pre">request.get_basic_auth_pw()</span></tt> must be called prior to using the -<tt class="xref py py-attr docutils literal"><span class="pre">request.user</span></tt> value. Apache makes no attempt to decode the -authentication information unless <tt class="xref py py-meth docutils literal"><span class="pre">request.get_basic_auth_pw()</span></tt> is called.</p> -</div> -</div> -<div class="section" id="pythonauthzhandler"> -<span id="dir-handlers-auzh"></span><h3>PythonAuthzHandler<a class="headerlink" href="#pythonauthzhandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This handler runs after AuthenHandler and is intended for checking -whether a user is allowed to access a particular resource. But more -often than not it is done right in the AuthenHandler.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then execution of all -subsequent handlers for this phase is aborted.</p> -</div> -<div class="section" id="pythontypehandler"> -<span id="dir-handlers-tph"></span><h3>PythonTypeHandler<a class="headerlink" href="#pythontypehandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This routine is called to determine and/or set the various document -type information bits, like Content-type (via <tt class="docutils literal"><span class="pre">r->content_type</span></tt>), -language, et cetera.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then execution of all -subsequent handlers for this phase is aborted.</p> -</div> -<div class="section" id="pythonfixuphandler"> -<span id="dir-handlers-fuh"></span><h3>PythonFixupHandler<a class="headerlink" href="#pythonfixuphandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This routine is called to perform any module-specific fixing of header -fields, et cetera. It is invoked just before any content-handler.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.OK</span></tt> or <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then -execution of all subsequent handlers for this phase is aborted.</p> -</div> -<div class="section" id="pythonhandler"> -<span id="dir-handlers-ph"></span><h3>PythonHandler<a class="headerlink" href="#pythonhandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This is the main request handler. Many applications will only provide -this one handler.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a status value other than <tt class="docutils literal"><span class="pre">apache.OK</span></tt> or -<tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then execution of subsequent handlers for the phase -are skipped and the return status becomes that for the whole content -handler phase. If all handlers are run, the return status of the final -handler is what becomes the return status of the whole content handler -phase. Where that final status is <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, Apache will fall -back to using the <tt class="docutils literal"><span class="pre">default-handler</span></tt> and attempt to serve up the target -as a static file.</p> -</div> -<div class="section" id="pythonloghandler"> -<span id="dir-handlers-plh"></span><h3>PythonLogHandler<a class="headerlink" href="#pythonloghandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This routine is called to perform any module-specific logging -activities.</p> -<p>Where multiple handlers are specified, if any handler in the sequence -returns a value other than <tt class="docutils literal"><span class="pre">apache.OK</span></tt> or <tt class="docutils literal"><span class="pre">apache.DECLINED</span></tt>, then -execution of all subsequent handlers for this phase is aborted.</p> -</div> -<div class="section" id="pythoncleanuphandler"> -<span id="dir-handlers-pch"></span><h3>PythonCleanupHandler<a class="headerlink" href="#pythoncleanuphandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> <em>Python*Handler Syntax</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>This is the very last handler, called just before the request object -is destroyed by Apache.</p> -<p>Unlike all the other handlers, the return value of this handler is -ignored. Any errors will be logged to the error log, but will not be -sent to the client, even if PythonDebug is On.</p> -<p>This handler is not a valid argument to the <tt class="docutils literal"><span class="pre">rec.add_handler()</span></tt> -function. For dynamic clean up registration, use -<tt class="docutils literal"><span class="pre">req.register_cleanup()</span></tt>.</p> -<p>Once cleanups have started, it is not possible to register more of -them. Therefore, <tt class="docutils literal"><span class="pre">req.register_cleanup()</span></tt> has no effect within this -handler.</p> -<p>Cleanups registered with this directive will execute <em>after</em> cleanups -registered with <tt class="docutils literal"><span class="pre">req.register_cleanup()</span></tt>.</p> -</div> -</div> -<div class="section" id="filters"> -<span id="dir-filter"></span><h2>Filters<a class="headerlink" href="#filters" title="Permalink to this headline">¶</a></h2> -<div class="section" id="pythoninputfilter"> -<span id="dir-filter-if"></span><h3>PythonInputFilter<a class="headerlink" href="#pythoninputfilter" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonInputFilter handler name <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Registers an input filter <em>handler</em> under name <em>name</em>. <em>Handler</em> is a -module name optionally followed <tt class="docutils literal"><span class="pre">::</span></tt> and a callable object name. If -callable object name is omitted, it will default to -<tt class="docutils literal"><span class="pre">'inputfilter'</span></tt>. <em>Name</em> is the name under which the filter is -registered, by convention filter names are usually in all caps.</p> -<p>The <em>module</em> referred to by the handler can be a full module name -(package dot notation is accepted) or an actual path to a module code file. -The module is loaded using the mod_python module importer as implemented by -the <a class="reference internal" href="pythonapi.html#apache.import_module" title="apache.import_module"><tt class="xref py py-func docutils literal"><span class="pre">apache.import_module()</span></tt></a> function. Reference should be made to the -documentation of that function for further details of how module importing -is managed.</p> -<p>To activate the filter, use the <tt class="docutils literal"><span class="pre">AddInputFilter</span></tt> directive.</p> -</div> -<div class="section" id="pythonoutputfilter"> -<span id="dir-filter-of"></span><h3>PythonOutputFilter<a class="headerlink" href="#pythonoutputfilter" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonOutputFilter handler name <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Registers an output filter <em>handler</em> under name <em>name</em>. <em>handler</em> is a -module name optionally followed <tt class="docutils literal"><span class="pre">::</span></tt> and a callable object name. If -callable object name is omitted, it will default to -<tt class="docutils literal"><span class="pre">'outputfilter'</span></tt>. <em>name</em> is the name under which the filter is -registered, by convention filter names are usually in all caps.</p> -<p>The <em>module</em> referred to by the handler can be a full module name -(package dot notation is accepted) or an actual path to a module code file. -The module is loaded using the mod_python module importer as implemented by -the <a class="reference internal" href="pythonapi.html#apache.import_module" title="apache.import_module"><tt class="xref py py-func docutils literal"><span class="pre">apache.import_module()</span></tt></a> function. Reference should be made to the -documentation of that function for further details of how module importing -is managed.</p> -<p>To activate the filter, use the <tt class="docutils literal"><span class="pre">AddOutputFilter</span></tt> directive.</p> -</div> -</div> -<div class="section" id="connection-handler"> -<span id="dir-conn"></span><h2>Connection Handler<a class="headerlink" href="#connection-handler" title="Permalink to this headline">¶</a></h2> -<div class="section" id="pythonconnectionhandler"> -<span id="dir-conn-ch"></span><h3>PythonConnectionHandler<a class="headerlink" href="#pythonconnectionhandler" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonConnectionHandler handler <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Specifies that the connection should be handled with <em>handler</em> -connection handler. <em>handler</em> will be passed a single argument - -the connection object.</p> -<p><em>Handler</em> is a module name optionally followed <tt class="docutils literal"><span class="pre">::</span></tt> and a -callable object name. If callable object name is omitted, it will -default to <tt class="docutils literal"><span class="pre">'connectionhandler'</span></tt>.</p> -<p>The <em>module</em> can be a full module name (package dot notation is -accepted) or an absolute path to a module code file. The module is loaded -using the mod_python module importer as implemented by the -<a class="reference internal" href="pythonapi.html#apache.import_module" title="apache.import_module"><tt class="xref py py-func docutils literal"><span class="pre">apache.import_module()</span></tt></a> function. Reference should be made to the -documentation of that function for further details of how module importing -is managed.</p> -</div> -</div> -<div class="section" id="other-directives"> -<span id="dir-other"></span><h2>Other Directives<a class="headerlink" href="#other-directives" title="Permalink to this headline">¶</a></h2> -<div class="section" id="pythonenablepdb"> -<span id="dir-other-epd"></span><h3>PythonEnablePdb<a class="headerlink" href="#pythonenablepdb" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonEnablePdb {On, Off} <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default">Default:</a> PythonEnablePdb Off <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>When On, mod_python will execute the handler functions within the -Python debugger pdb using the <tt class="xref py py-func docutils literal"><span class="pre">pdb.runcall()</span></tt> function.</p> -<p>Because pdb is an interactive tool, start httpd from the command line -with the <tt class="docutils literal"><span class="pre">-DONE_PROCESS</span></tt> option when using this directive. As soon as -your handler code is entered, you will see a Pdb prompt allowing you -to step through the code and examine variables.</p> -</div> -<div class="section" id="pythondebug"> -<span id="dir-other-pd"></span><h3>PythonDebug<a class="headerlink" href="#pythondebug" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonDebug {On, Off} <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default">Default:</a> PythonDebug Off <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Normally, the traceback output resulting from uncaught Python errors -is sent to the error log. With PythonDebug On directive specified, the -output will be sent to the client (as well as the log), except when -the error is <tt class="xref py py-exc docutils literal"><span class="pre">IOError</span></tt> while writing, in which case it will go -to the error log.</p> -<p>This directive is very useful during the development process. It is -recommended that you do not use it production environment as it may -reveal to the client unintended, possibly sensitive security -information.</p> -</div> -<div class="section" id="pythonimport"> -<span id="dir-other-pimp"></span><h3>PythonImport<a class="headerlink" href="#pythonimport" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonImport <em>module</em> <em>interpreter_name</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Tells the server to import the Python module module at process startup -under the specified interpreter name. The import takes place at child -process initialization, so the module will actually be imported once for -every child process spawned.</p> -<p>The <em>module</em> can be a full module name (package dot notation is -accepted) or an absolute path to a module code file. The module is loaded -using the mod_python module importer as implemented by the -<a class="reference internal" href="pythonapi.html#apache.import_module" title="apache.import_module"><tt class="xref py py-func docutils literal"><span class="pre">apache.import_module()</span></tt></a> function. Reference should be made to -the documentation of that function for further details of how module -importing is managed.</p> -<p>The <tt class="docutils literal"><span class="pre">PythonImport</span></tt> directive is useful for initialization tasks that -could be time consuming and should not be done at the time of processing a -request, e.g. initializing a database connection. Where such initialization -code could fail and cause the importing of the module to fail, it should be -placed in its own function and the alternate syntax used:</p> -<p><tt class="docutils literal"><span class="pre">PythonImport</span> <span class="pre">*module::function*</span> <span class="pre">*interpreter_name*</span></tt></p> -<p>The named function will be called only after the module has been imported -successfully. The function will be called with no arguments.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">At the time when the import takes place, the configuration is not -completely read yet, so all other directives, including -PythonInterpreter have no effect on the behavior of modules -imported by this directive. Because of this limitation, the -interpreter must be specified explicitly, and must match the name -under which subsequent requests relying on this operation will -execute. If you are not sure under what interpreter name a request -is running, examine the <tt class="xref py py-attr docutils literal"><span class="pre">request.interpreter</span></tt> member of the request -object.</p> -</div> -<p>See also Multiple Interpreters.</p> -</div> -<div class="section" id="pythoninterpperdirectory"> -<span id="dir-other-ipd"></span><h3>PythonInterpPerDirectory<a class="headerlink" href="#pythoninterpperdirectory" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonInterpPerDirectory {On, Off} <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default">Default:</a> PythonInterpPerDirectory Off <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Instructs mod_python to name subinterpreters using the directory of -the file in the request (<tt class="docutils literal"><span class="pre">req.filename</span></tt>) rather than the the -server name. This means that scripts in different directories will -execute in different subinterpreters as opposed to the default policy -where scripts in the same virtual server execute in the same -subinterpreter, even if they are in different directories.</p> -<p>For example, assume there is a -<tt class="file docutils literal"><span class="pre">/directory/subdirectory</span></tt>. <tt class="file docutils literal"><span class="pre">/directory</span></tt> has an -<tt class="docutils literal"><span class="pre">.htaccess</span></tt> file with a <tt class="docutils literal"><span class="pre">PythonHandler</span></tt> directive. -<tt class="file docutils literal"><span class="pre">/directory/subdirectory</span></tt> doesn’t have an <tt class="docutils literal"><span class="pre">.htaccess</span></tt>. By -default, scripts in <tt class="file docutils literal"><span class="pre">/directory</span></tt> and -<tt class="file docutils literal"><span class="pre">/directory/subdirectory</span></tt> would execute in the same interpreter -assuming both directories are accessed via the same virtual -server. With <tt class="docutils literal"><span class="pre">PythonInterpPerDirectory</span></tt>, there would be two -different interpreters, one for each directory.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">In early phases of the request prior to the URI translation -(PostReadRequestHandler and TransHandler) the path is not yet known -because the URI has not been translated. During those phases and -with PythonInterpPerDirectory on, all python code gets executed in -the main interpreter. This may not be exactly what you want, but -unfortunately there is no way around this.</p> -</div> -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><a class="reference internal" href="pythonapi.html#pyapi-interps"><em>Multiple Interpreters</em></a></dt> -<dd>for more information</dd> -</dl> -</div> -</div> -<div class="section" id="pythoninterpperdirective"> -<span id="dir-other-ipdv"></span><h3>PythonInterpPerDirective<a class="headerlink" href="#pythoninterpperdirective" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonInterpPerDirective {On, Off} <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default">Default:</a> PythonInterpPerDirective Off <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Instructs mod_python to name subinterpreters using the directory in -which the Python*Handler directive currently in effect was -encountered.</p> -<p>For example, assume there is a -<tt class="file docutils literal"><span class="pre">/directory/subdirectory</span></tt>. <tt class="file docutils literal"><span class="pre">/directory</span></tt> has an <tt class="docutils literal"><span class="pre">.htaccess</span></tt> -file with a <tt class="docutils literal"><span class="pre">PythonHandler</span></tt> directive. <tt class="file docutils literal"><span class="pre">/directory/subdirectory</span></tt> -has another <tt class="file docutils literal"><span class="pre">.htaccess</span></tt> file with another <tt class="docutils literal"><span class="pre">PythonHandler</span></tt>. By -default, scripts in <tt class="file docutils literal"><span class="pre">/directory</span></tt> and -<tt class="file docutils literal"><span class="pre">/directory/subdirectory</span></tt> would execute in the same interpreter -assuming both directories are in the same virtual server. With -<tt class="docutils literal"><span class="pre">PythonInterpPerDirective</span></tt>, there would be two different interpreters, -one for each directive.</p> -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><a class="reference internal" href="pythonapi.html#pyapi-interps"><em>Multiple Interpreters</em></a></dt> -<dd>for more information</dd> -</dl> -</div> -</div> -<div class="section" id="pythoninterpreter"> -<span id="dir-other-pi"></span><h3>PythonInterpreter<a class="headerlink" href="#pythoninterpreter" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonInterpreter <em>name</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Forces mod_python to use interpreter named <em>name</em>, overriding the -default behaviour or behaviour dictated by a <a class="reference internal" href="#dir-other-ipd"><em>PythonInterpPerDirectory</em></a> or -<a class="reference internal" href="#dir-other-ipdv"><em>PythonInterpPerDirective</em></a> direcive.</p> -<p>This directive can be used to force execution that would normally -occur in different subinterpreters to run in the same one. When -specified in the DocumentRoot, it forces the whole server to run in one -subinterpreter.</p> -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><a class="reference internal" href="pythonapi.html#pyapi-interps"><em>Multiple Interpreters</em></a></dt> -<dd>for more information</dd> -</dl> -</div> -</div> -<div class="section" id="pythonhandlermodule"> -<span id="dir-other-phm"></span><h3>PythonHandlerModule<a class="headerlink" href="#pythonhandlermodule" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonHandlerModule <em>module</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>PythonHandlerModule can be used an alternative to Python*Handler -directives. The module specified in this handler will be searched for -existence of functions matching the default handler function names, -and if a function is found, it will be executed.</p> -<p>For example, instead of:</p> -<div class="highlight-python"><pre>PythonAuthenHandler mymodule -PythonHandler mymodule -PythonLogHandler mymodule</pre> -</div> -<p>one can simply use:</p> -<div class="highlight-python"><pre>PythonHandlerModule mymodule</pre> -</div> -</div> -<div class="section" id="pythonautoreload"> -<span id="dir-other-par"></span><h3>PythonAutoReload<a class="headerlink" href="#pythonautoreload" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonAutoReload {On, Off} <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default">Default:</a> PythonAutoReload On <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>If set to Off, instructs mod_python not to check the modification date -of the module file.</p> -<p>By default, mod_python checks the time-stamp of the file and reloads -the module if the module’s file modification date is later than the -last import or reload. This way changed modules get automatically -reimported, eliminating the need to restart the server for every -change.</p> -<p>Disabling autoreload is useful in production environment where the -modules do not change; it will save some processing time and give a -small performance gain.</p> -</div> -<div class="section" id="pythonoptimize"> -<span id="dir-other-pomz"></span><h3>PythonOptimize<a class="headerlink" href="#pythonoptimize" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonOptimize {On, Off} <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Default">Default:</a> PythonOptimize Off <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Enables Python optimization. Same as the Python <tt class="docutils literal"><span class="pre">-O</span></tt> option.</p> -</div> -<div class="section" id="pythonoption"> -<span id="dir-other-po"></span><h3>PythonOption<a class="headerlink" href="#pythonoption" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonOption key [value] <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>Assigns a key value pair to a table that can be later retrieved by the -<tt class="xref py py-meth docutils literal"><span class="pre">request.get_options()</span></tt> function. This is useful to pass information -between the apache configuration files (<tt class="file docutils literal"><span class="pre">httpd.conf</span></tt>, -<tt class="file docutils literal"><span class="pre">.htaccess</span></tt>, etc) and the Python programs. If the value is omitted or empty (<tt class="docutils literal"><span class="pre">""</span></tt>), -then the key is removed from the local configuration.</p> -<div class="section" id="reserved-pythonoption-keywords"> -<h4>Reserved PythonOption Keywords<a class="headerlink" href="#reserved-pythonoption-keywords" title="Permalink to this headline">¶</a></h4> -<p>Some <tt class="docutils literal"><span class="pre">PythonOption</span></tt> keywords are used for configuring various aspects of -mod_python. Any keyword starting with mod_python.* should be considered -as reserved for internal mod_python use.</p> -<p>Users are encouraged to use their own namespace qualifiers when creating -add-on modules, and not pollute the global namespace.</p> -<p>The following PythonOption keys are currently used by mod_python.</p> -<div class="line-block"> -<div class="line">mod_python.mutex_directory</div> -<div class="line">mod_python.mutex_locks</div> -<div class="line">mod_python.psp.cache_database_filename</div> -<div class="line">mod_python.session.session_type</div> -<div class="line">mod_python.session.cookie_name</div> -<div class="line">mod_python.session.application_domain</div> -<div class="line">mod_python.session.application_path</div> -<div class="line">mod_python.session.database_directory</div> -<div class="line">mod_python.dbm_session.database_filename</div> -<div class="line">mod_python.dbm_session.database_directory</div> -<div class="line">mod_python.file_session.enable_fast_cleanup</div> -<div class="line">mod_python.file_session.verify_session_timeout</div> -<div class="line">mod_python.file_session.cleanup_grace_period</div> -<div class="line">mod_python.file_session.cleanup_time_limit</div> -<div class="line">mod_python.file_session.database_directory</div> -<div class="line">mod_python.wsgi.application</div> -<div class="line">mod_python.wsgi.base_uri</div> -</div> -<div class="line-block"> -<div class="line">session <em>Deprecated in 3.3, use mod_python.session.session_type</em></div> -<div class="line">ApplicationPath <em>Deprecated in 3.3, use mod_python.session.application_path</em></div> -<div class="line">session_cookie_name <em>Deprecated in 3.3, use mod_python.session.cookie_name</em></div> -<div class="line">session_directory <em>Deprecated in 3.3, use mod_python.session.database_directory</em></div> -<div class="line">session_dbm <em>Deprecated in 3.3, use mod_python.dbm_session.database_filename</em></div> -<div class="line">session_cleanup_time_limit <em>Deprecated in 3.3, use mod_python.file_session.cleanup_time_limit</em></div> -<div class="line">session_fast_cleanup <em>Deprecated in 3.3, use mod_python.file_session.enable_fast_cleanup</em></div> -<div class="line">session_grace_period <em>Deprecated in 3.3, use mod_python.file_session.cleanup_grace_period</em></div> -<div class="line">session_verify_cleanup <em>Deprecated in 3.3, use mod_python.file_session.cleanup_session_timeout</em></div> -<div class="line">PSPDbmCache <em>Deprecated in 3.3, use mod_python.psp.cache_database_filename</em></div> -</div> -</div> -</div> -<div class="section" id="pythonpath"> -<span id="dir-other-pp"></span><h3>PythonPath<a class="headerlink" href="#pythonpath" title="Permalink to this headline">¶</a></h3> -<p><a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Syntax">Syntax:</a> PythonPath <em>path</em> <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Context">Context:</a> server config, virtual host, directory, htaccess <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Override">Override:</a> not None <br /> -<a class="reference external" href="http://httpd.apache.org/docs-2.4/mod/directive-dict.html#Module">Module:</a> mod_python.c <br /></p> -<p>PythonPath directive sets the PythonPath. The path must be specified -in Python list notation, e.g.:</p> -<div class="highlight-python"><pre>PythonPath "['/usr/local/lib/python2.0', '/usr/local/lib/site_python', '/some/other/place']"</pre> -</div> -<p>The path specified in this directive will replace the path, not add to -it. However, because the value of the directive is evaled, to append a -directory to the path, one can specify something like:</p> -<div class="highlight-python"><pre>PythonPath "sys.path+['/mydir']"</pre> -</div> -<p>Mod_python tries to minimize the number of evals associated with the -PythonPath directive because evals are slow and can negatively impact -performance, especially when the directive is specified in an -<tt class="file docutils literal"><span class="pre">.htaccess</span></tt> file which gets parsed at every hit. Mod_python will -remember the arguments to the PythonPath directive in the un-evaled -form, and before evaling the value it will compare it to the -remembered value. If the value is the same, no action is -taken. Because of this, you should not rely on the directive as a way -to restore the pythonpath to some value if your code changes it.</p> -<p>When multiple PythonPath directives are specified, the effect is not -cumulative, last directive will override all previous ones.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">This directive should not be used as a security measure since the -Python path is easily manipulated from within the scripts.</p> -</div> -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Apache Configuration Directives</a><ul> -<li><a class="reference internal" href="#request-handlers">Request Handlers</a><ul> -<li><a class="reference internal" href="#python-handler-directive-syntax">Python*Handler Directive Syntax</a></li> -<li><a class="reference internal" href="#python-handlers-and-python-path">Python*Handlers and Python path</a></li> -<li><a class="reference internal" href="#pythonpostreadrequesthandler">PythonPostReadRequestHandler</a></li> -<li><a class="reference internal" href="#pythontranshandler">PythonTransHandler</a></li> -<li><a class="reference internal" href="#pythonheaderparserhandler">PythonHeaderParserHandler</a></li> -<li><a class="reference internal" href="#pythoninithandler">PythonInitHandler</a></li> -<li><a class="reference internal" href="#pythonaccesshandler">PythonAccessHandler</a></li> -<li><a class="reference internal" href="#pythonauthenhandler">PythonAuthenHandler</a></li> -<li><a class="reference internal" href="#pythonauthzhandler">PythonAuthzHandler</a></li> -<li><a class="reference internal" href="#pythontypehandler">PythonTypeHandler</a></li> -<li><a class="reference internal" href="#pythonfixuphandler">PythonFixupHandler</a></li> -<li><a class="reference internal" href="#pythonhandler">PythonHandler</a></li> -<li><a class="reference internal" href="#pythonloghandler">PythonLogHandler</a></li> -<li><a class="reference internal" href="#pythoncleanuphandler">PythonCleanupHandler</a></li> -</ul> -</li> -<li><a class="reference internal" href="#filters">Filters</a><ul> -<li><a class="reference internal" href="#pythoninputfilter">PythonInputFilter</a></li> -<li><a class="reference internal" href="#pythonoutputfilter">PythonOutputFilter</a></li> -</ul> -</li> -<li><a class="reference internal" href="#connection-handler">Connection Handler</a><ul> -<li><a class="reference internal" href="#pythonconnectionhandler">PythonConnectionHandler</a></li> -</ul> -</li> -<li><a class="reference internal" href="#other-directives">Other Directives</a><ul> -<li><a class="reference internal" href="#pythonenablepdb">PythonEnablePdb</a></li> -<li><a class="reference internal" href="#pythondebug">PythonDebug</a></li> -<li><a class="reference internal" href="#pythonimport">PythonImport</a></li> -<li><a class="reference internal" href="#pythoninterpperdirectory">PythonInterpPerDirectory</a></li> -<li><a class="reference internal" href="#pythoninterpperdirective">PythonInterpPerDirective</a></li> -<li><a class="reference internal" href="#pythoninterpreter">PythonInterpreter</a></li> -<li><a class="reference internal" href="#pythonhandlermodule">PythonHandlerModule</a></li> -<li><a class="reference internal" href="#pythonautoreload">PythonAutoReload</a></li> -<li><a class="reference internal" href="#pythonoptimize">PythonOptimize</a></li> -<li><a class="reference internal" href="#pythonoption">PythonOption</a><ul> -<li><a class="reference internal" href="#reserved-pythonoption-keywords">Reserved PythonOption Keywords</a></li> -</ul> -</li> -<li><a class="reference internal" href="#pythonpath">PythonPath</a></li> -</ul> -</li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="pythonapi.html" - title="previous chapter">Python API</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="handlers.html" - title="next chapter">Standard Handlers</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/directives.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="handlers.html" title="Standard Handlers" - >next</a> |</li> - <li class="right" > - <a href="pythonapi.html" title="Python API" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-A.html b/doc-html/genindex-A.html deleted file mode 100644 index d2511d6e81922764200ce9f4b8db3c6f78726983..0000000000000000000000000000000000000000 --- a/doc-html/genindex-A.html +++ /dev/null @@ -1,164 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – A</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.connection.aborted">aborted (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.table.add">add() (apache.table method)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_cgi_vars">add_cgi_vars() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_common_vars">add_common_vars() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#Cookie.add_cookie">add_cookie() (in module Cookie)</a></dt> - <dt><a href="pythonapi.html#util.add_field">add_field() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_handler">add_handler() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_input_filter">add_input_filter() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_output_filter">add_output_filter() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.allow_methods">allow_methods() (apache.request method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.allow_methods">(in module apache)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.allowed">allowed (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.allowed_methods">allowed_methods (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.allowed_xmethods">allowed_xmethods (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.ap_auth_type">ap_auth_type (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#module-apache">apache (module)</a></dt> - <dt>apache configuration</dt> - <dd><dl> - <dt><a href="installation.html#index-10">LoadModule</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#httpdconf.Container.append">append() (httpdconf.Container method)</a></dt> - <dt><a href="pythonapi.html#psp.PSPInterface.apply_data">apply_data() (psp.PSPInterface method)</a></dt> - <dt><a href="installation.html#index-0">apxs</a></dt> - <dt><a href="pythonapi.html#apache.request.args">args (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.assbackwards">assbackwards (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.auth_name">auth_name() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#index-11">AUTH_TYPE</a></dt> - <dt><a href="pythonapi.html#apache.request.auth_type">auth_type() (apache.request method)</a></dt> - <dt>authentication</dt> - <dd><dl> - <dt><a href="handlers.html#index-2">publisher</a></dt> - </dl></dd> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="#"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-B.html b/doc-html/genindex-B.html deleted file mode 100644 index dfeaaad1a6e0e2554e70b1ee21b209c390b75276..0000000000000000000000000000000000000000 --- a/doc-html/genindex-B.html +++ /dev/null @@ -1,133 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – B</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.connection.base_server">base_server (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession">BaseSession (class in Session)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.bytes_sent">bytes_sent (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="#"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-C.html b/doc-html/genindex-C.html deleted file mode 100644 index 927525fb06a751ff2df022d3b94e9c9db233cb42..0000000000000000000000000000000000000000 --- a/doc-html/genindex-C.html +++ /dev/null @@ -1,167 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – C</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.canonical_filename">canonical_filename (apache.request attribute)</a></dt> - <dt>CGI</dt> - <dd><dl> - <dt><a href="handlers.html#index-9">handler</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.chunked">chunked (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.cleanup">cleanup() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#util.clear">clear() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.clength">clength (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.client_addr">client_addr (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.client_ip">client_ip (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.filter.close">close() (apache.filter method)</a></dt> - <dt><a href="pythonapi.html#apache.filter.closed">closed (apache.filter attribute)</a></dt> - <dt>command line option</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--listen">--listen</a></dt> - <dt><a href="commandline.html#cmdoption--pythonhandler">--pythonhandler</a></dt> - <dt><a href="commandline.html#cmdoption--pythonoption">--pythonoption</a></dt> - <dt><a href="commandline.html#cmdoption--pythonpath">--pythonpath</a></dt> - </dl></dd> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#httpdconf.Comment">Comment (class in httpdconf)</a></dt> - <dt><a href="pythonapi.html#apache.config_tree">config_tree() (in module apache)</a></dt> - <dt>connection</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-4">handler</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.connection">connection (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.construct_url">construct_url() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#httpdconf.Container">Container (class in httpdconf)</a></dt> - <dt><a href="pythonapi.html#apache.request.content_encoding">content_encoding (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.content_languages">content_languages (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.content_type">content_type (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#Cookie.Cookie">Cookie (class in Cookie)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#module-Cookie">(module)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#Session.BaseSession.created">created() (Session.BaseSession method)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="#"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-D.html b/doc-html/genindex-D.html deleted file mode 100644 index 4cba27d2596dd555f193628d31b813d7c02626f2..0000000000000000000000000000000000000000 --- a/doc-html/genindex-D.html +++ /dev/null @@ -1,142 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – D</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Session.DbmSession">DbmSession (class in Session)</a></dt> - <dt><a href="pythonapi.html#apache.server.defn_line_number">defn_line_number (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.defn_name">defn_name (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.delete">delete() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#httpdconf.Directive">Directive (class in httpdconf)</a></dt> - <dt><a href="pythonapi.html#apache.filter.disable">disable() (apache.filter method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.discard_request_body">discard_request_body() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#psp.PSP.display_code">display_code() (psp.PSP method)</a></dt> - <dt><a href="pythonapi.html#util.Field.disposition">disposition (util.Field attribute)</a></dt> - <dt><a href="pythonapi.html#util.Field.disposition_options">disposition_options (util.Field attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.document_root">document_root() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.connection.double_reverse">double_reverse (apache.connection attribute)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="#"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-E.html b/doc-html/genindex-E.html deleted file mode 100644 index 00bd60ef922c3030686b2526dd76355b10ec70b2..0000000000000000000000000000000000000000 --- a/doc-html/genindex-E.html +++ /dev/null @@ -1,150 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – E</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt>environment variable</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-11">AUTH_TYPE</a></dt> - <dt><a href="installation.html#index-2">PATH</a>, <a href="installation.html#index-6">[1]</a></dt> - <dt><a href="pythonapi.html#index-12">PATH_INFO</a></dt> - <dt><a href="pythonapi.html#index-13">QUERY_ARGS</a></dt> - <dt><a href="pythonapi.html#index-14">REMOTE_ADDR</a>, <a href="pythonapi.html#index-16">[1]</a></dt> - <dt><a href="pythonapi.html#index-17">REMOTE_HOST</a></dt> - <dt><a href="pythonapi.html#index-19">REMOTE_IDENT</a></dt> - <dt><a href="pythonapi.html#index-10">REMOTE_USER</a></dt> - <dt><a href="pythonapi.html#index-9">REQUEST_METHOD</a></dt> - <dt><a href="pythonapi.html#index-22">SERVER_NAME</a></dt> - <dt><a href="pythonapi.html#index-23">SERVER_PORT</a></dt> - <dt><a href="pythonapi.html#index-8">SERVER_PROTOCOL</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.eos_sent">eos_sent (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.err_headers_out">err_headers_out (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.server.error_fname">error_fname (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.exists_config">exists_config() (in module apache)</a></dt> - <dt><a href="pythonapi.html#apache.request.expecting_100">expecting_100 (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="#"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-F.html b/doc-html/genindex-F.html deleted file mode 100644 index e6aeb9242423345d448fd65ddce0ec7bbf1c35b2..0000000000000000000000000000000000000000 --- a/doc-html/genindex-F.html +++ /dev/null @@ -1,148 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – F</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#util.Field">Field (class in util)</a></dt> - <dt><a href="pythonapi.html#util.FieldStorage">FieldStorage (class in util)</a></dt> - <dt><a href="pythonapi.html#util.Field.file">file (util.Field attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.filename">filename (apache.request attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#util.Field.filename">(util.Field attribute)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#Session.FileSession">FileSession (class in Session)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>filter</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-3">handler</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.finfo">finfo (apache.request attribute)</a></dt> - <dt><a href="installation.html#index-5">flex</a></dt> - <dt><a href="pythonapi.html#apache.filte.flush">flush() (apache.filte method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.request.flush">(apache.request method)</a></dt> - </dl></dd> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="#"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-G.html b/doc-html/genindex-G.html deleted file mode 100644 index da68432e840884a74ca0802cfbae72231a0bb372..0000000000000000000000000000000000000000 --- a/doc-html/genindex-G.html +++ /dev/null @@ -1,145 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – G</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#util.get">get() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.get_basic_auth_pw">get_basic_auth_pw() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.get_config">get_config() (apache.request method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.server.get_config">(apache.server method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#Cookie.get_cookie">get_cookie() (in module Cookie)</a></dt> - <dt><a href="pythonapi.html#Cookie.get_cookies">get_cookies() (in module Cookie)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.get_options">get_options() (apache.request method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.server.get_options">(apache.server method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.get_remote_host">get_remote_host() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#util.getfirst">getfirst() (in module util)</a></dt> - <dt><a href="pythonapi.html#util.getlist">getlist() (in module util)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="#"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-H.html b/doc-html/genindex-H.html deleted file mode 100644 index 0b84490511caf7613c512cc549d134b168184d24..0000000000000000000000000000000000000000 --- a/doc-html/genindex-H.html +++ /dev/null @@ -1,150 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – H</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="tutorial.html#index-0">handler</a></dt> - <dd><dl> - <dt><a href="handlers.html#index-9">CGI</a></dt> - <dt><a href="handlers.html#index-8">PSP</a></dt> - <dt><a href="handlers.html#index-3">WSGI</a></dt> - <dt><a href="pythonapi.html#index-4">connection</a></dt> - <dt><a href="pythonapi.html#index-3">filter</a></dt> - <dt><a href="handlers.html#index-0">publisher</a></dt> - <dt><a href="pythonapi.html#index-1">request</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.filter.handler">handler (apache.filter attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.request.handler">(apache.request attribute)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#util.has_key">has_key() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.header_only">header_only (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.headers_in">headers_in (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.headers_out">headers_out (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.hostname">hostname (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#module-httpdconf">httpdconf (module)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="#"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-I.html b/doc-html/genindex-I.html deleted file mode 100644 index d869bda2cedac301755daab92ca948ee4a270011..0000000000000000000000000000000000000000 --- a/doc-html/genindex-I.html +++ /dev/null @@ -1,157 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – I</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.connection.id">id (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.id">id() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.import_module">import_module() (in module apache)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.init_lock">init_lock() (Session.BaseSession method)</a></dt> - <dt>install</dt> - <dd><dl> - <dt><a href="installation.html#index-8">make</a></dt> - </dl></dd> - <dt>install_dso</dt> - <dd><dl> - <dt><a href="installation.html#index-9">make targets</a></dt> - </dl></dd> - <dt>install_py_lib</dt> - <dd><dl> - <dt><a href="installation.html#index-9">make targets</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.internal_redirect">internal_redirect() (apache.request method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.interpreter">interpreter (apache.request attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.interpreter">(in module apache)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#Session.BaseSession.invalidate">invalidate() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.request.is_https">is_https() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.filter.is_input">is_input (apache.filter attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.is_new">is_new() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.server.is_virtual">is_virtual (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#util.items">items() (in module util)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="#"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-K.html b/doc-html/genindex-K.html deleted file mode 100644 index 146286ad582122292cf2f606672033ed744da299..0000000000000000000000000000000000000000 --- a/doc-html/genindex-K.html +++ /dev/null @@ -1,136 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – K</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.server.keep_alive">keep_alive (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.keep_alive_max">keep_alive_max (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.keep_alive_timeout">keep_alive_timeout (apache.server attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.connection.keepalive">keepalive (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.keepalives">keepalives (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#util.keys">keys() (in module util)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="#"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-L.html b/doc-html/genindex-L.html deleted file mode 100644 index 195da827e86cf7b056f3872391b22fe8ce86a58a..0000000000000000000000000000000000000000 --- a/doc-html/genindex-L.html +++ /dev/null @@ -1,152 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – L</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Session.BaseSession.last_accessed">last_accessed() (Session.BaseSession method)</a></dt> - <dt><a href="installation.html#index-1">libpython.a</a></dt> - <dt><a href="pythonapi.html#apache.server.limit_req_fields">limit_req_fields (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.limit_req_fieldsize">limit_req_fieldsize (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.limit_req_line">limit_req_line (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#util.FieldStorage.list">list (util.FieldStorage attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.load">load() (Session.BaseSession method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>LoadModule</dt> - <dd><dl> - <dt><a href="installation.html#index-10">apache configuration</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.connection.local_addr">local_addr (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.local_host">local_host (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.local_ip">local_ip (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.lock">lock() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.connection.log_error">log_error() (apache.connection method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.request.log_error">(apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.server.log_error">(apache.server method)</a></dt> - <dt><a href="pythonapi.html#apache.log_error">(in module apache)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.server.loglevel">loglevel (apache.server attribute)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="#"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-M.html b/doc-html/genindex-M.html deleted file mode 100644 index 30671768c926e0ad48a20ced0eece8620a163118..0000000000000000000000000000000000000000 --- a/doc-html/genindex-M.html +++ /dev/null @@ -1,158 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – M</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.main">main (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#index-0">main_interpreter</a></dt> - <dt><a href="pythonapi.html#apache.main_server">main_server (in module apache)</a></dt> - <dt><a href="installation.html#index-7">make</a></dt> - <dd><dl> - <dt><a href="installation.html#index-8">install</a></dt> - </dl></dd> - <dt>make targets</dt> - <dd><dl> - <dt><a href="installation.html#index-9">install_dso</a></dt> - <dt><a href="installation.html#index-9">install_py_lib</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.make_table">make_table() (in module apache)</a></dt> - <dt><a href="pythonapi.html#Cookie.MarshalCookie">MarshalCookie (class in Cookie)</a></dt> - <dt><a href="pythonapi.html#apache.request.meets_conditions">meets_conditions() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#Session.MemorySession">MemorySession (class in Session)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.method">method (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.method_number">method_number (apache.request attribute)</a></dt> - <dt><a href="installation.html#index-10">mod_python.so</a></dt> - <dt>module</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-5">_apache</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.MODULE_MAGIC_NUMBER_MAJOR">MODULE_MAGIC_NUMBER_MAJOR (in module apache)</a></dt> - <dt><a href="pythonapi.html#apache.MODULE_MAGIC_NUMBER_MINOR">MODULE_MAGIC_NUMBER_MINOR (in module apache)</a></dt> - <dt><a href="pythonapi.html#index-21">mp_server</a></dt> - <dt><a href="pythonapi.html#apache.mpm_query">mpm_query() (in module apache)</a></dt> - <dt><a href="pythonapi.html#apache.request.mtime">mtime (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="#"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-N.html b/doc-html/genindex-N.html deleted file mode 100644 index 88e5fd9267640d1b795fc647418ebe56240a5720..0000000000000000000000000000000000000000 --- a/doc-html/genindex-N.html +++ /dev/null @@ -1,142 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – N</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.filter.name">name (apache.filter attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#util.Field.name">(util.Field attribute)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.server.names">names (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.next">next (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.no_cache">no_cache (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.no_local_copy">no_local_copy (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.notes">notes (apache.connection attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.request.notes">(apache.request attribute)</a></dt> - </dl></dd> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="#"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-O.html b/doc-html/genindex-O.html deleted file mode 100644 index 39b671555317422604c33cefd58a1bfdae770b2d..0000000000000000000000000000000000000000 --- a/doc-html/genindex-O.html +++ /dev/null @@ -1,138 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – O</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt>object</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-2">request</a></dt> - </dl></dd> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>order</dt> - <dd><dl> - <dt><a href="directives.html#index-1">phase</a></dt> - </dl></dd> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="#"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-P.html b/doc-html/genindex-P.html deleted file mode 100644 index a592c799f8e7fe991207e9f8fec8043b3b1b8c29..0000000000000000000000000000000000000000 --- a/doc-html/genindex-P.html +++ /dev/null @@ -1,198 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – P</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Cookie.Cookie.parse">parse() (Cookie.Cookie method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#Cookie.SignedCookie.parse">(Cookie.SignedCookie method)</a></dt> - <dt><a href="pythonapi.html#psp.parse">(in module psp)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#util.parse_qs">parse_qs() (in module util)</a></dt> - <dt><a href="pythonapi.html#util.parse_qsl">parse_qsl() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.parsed_uri">parsed_uri (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#psp.parsestring">parsestring() (in module psp)</a></dt> - <dt><a href="pythonapi.html#apache.filter.pass_on">pass_on() (apache.filter method)</a></dt> - <dt><a href="installation.html#index-2">PATH</a>, <a href="installation.html#index-6">[1]</a></dt> - <dt><a href="pythonapi.html#apache.server.path">path (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#index-12">PATH_INFO</a></dt> - <dd><dl> - <dt><a href="handlers.html#index-5">WSGI</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.path_info">path_info (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.pathlen">pathlen (apache.server attribute)</a></dt> - <dt>phase</dt> - <dd><dl> - <dt><a href="directives.html#index-1">order</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.phase">phase (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.port">port (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.prev">prev (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.proto_num">proto_num (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.protocol">protocol (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.proxyreq">proxyreq (apache.request attribute)</a></dt> - <dt>PSP</dt> - <dd><dl> - <dt><a href="handlers.html#index-8">handler</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#module-psp">psp (module)</a></dt> - <dt><a href="pythonapi.html#psp.PSPInterface">PSPInterface (class in psp)</a></dt> - <dt>publisher</dt> - <dd><dl> - <dt><a href="handlers.html#index-2">authentication</a></dt> - <dt><a href="handlers.html#index-0">handler</a></dt> - <dt><a href="handlers.html#index-1">traversal</a></dt> - </dl></dd> - <dt><a href="handlers.html#index-4">Python Enhancement Proposals!PEP 333</a>, <a href="handlers.html#index-6">[1]</a></dt> - <dt><a href="directives.html#index-0">Python*Handler Syntax</a></dt> - <dt><a href="directives.html#index-7">PythonAccessHandler</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="directives.html#index-8">PythonAuthenHandler</a></dt> - <dt><a href="directives.html#index-9">PythonAuthzHandler</a></dt> - <dt><a href="directives.html#index-25">PythonAutoReload</a></dt> - <dt><a href="directives.html#index-14">PythonCleanupHandler</a></dt> - <dt><a href="directives.html#index-17">PythonConnectionHandler</a></dt> - <dt><a href="directives.html#index-19">PythonDebug</a></dt> - <dt><a href="directives.html#index-18">PythonEnablePdb</a></dt> - <dt><a href="directives.html#index-11">PythonFixupHandler</a></dt> - <dt><a href="directives.html#index-12">PythonHandler</a></dt> - <dt><a href="directives.html#index-24">PythonHandlerModule</a></dt> - <dt><a href="directives.html#index-5">PythonHeaderParserHandler</a></dt> - <dt><a href="directives.html#index-20">PythonImport</a></dt> - <dt><a href="directives.html#index-6">PythonInitHandler</a></dt> - <dt><a href="directives.html#index-15">PythonInputFilter</a></dt> - <dt><a href="directives.html#index-22">PythonInterpPerDirective</a></dt> - <dt><a href="directives.html#index-21">PythonInterpPerDirectory</a></dt> - <dt><a href="directives.html#index-23">PythonInterpreter</a></dt> - <dt><a href="directives.html#index-13">PythonLogHandler</a></dt> - <dt><a href="directives.html#index-26">PythonOptimize</a></dt> - <dt><a href="directives.html#index-27">PythonOption</a></dt> - <dt><a href="directives.html#index-16">PythonOutputFilter</a></dt> - <dt><a href="directives.html#index-28">PythonPath</a></dt> - <dt><a href="directives.html#index-3">PythonPostReadRequestHandler</a></dt> - <dt><a href="directives.html#index-4">PythonTransHandler</a></dt> - <dt><a href="directives.html#index-10">PythonTypeHandler</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="#"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-Q.html b/doc-html/genindex-Q.html deleted file mode 100644 index 4fbc53a70d42008ce25560b0064eb147a39aae6f..0000000000000000000000000000000000000000 --- a/doc-html/genindex-Q.html +++ /dev/null @@ -1,129 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – Q</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#index-13">QUERY_ARGS</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="#"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-R.html b/doc-html/genindex-R.html deleted file mode 100644 index a6867083c166023db80df28ccf60ba75f8a7f5d6..0000000000000000000000000000000000000000 --- a/doc-html/genindex-R.html +++ /dev/null @@ -1,188 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – R</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.range">range (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.read">read() (apache.connection method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.filter.read">(apache.filter method)</a></dt> - <dt><a href="pythonapi.html#apache.request.read">(apache.request method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.read_body">read_body (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.read_chunked">read_chunked (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.read_length">read_length (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.readline">readline() (apache.connection method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.filter.readline">(apache.filter method)</a></dt> - <dt><a href="pythonapi.html#apache.request.readline">(apache.request method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.readlines">readlines() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#util.redirect">redirect() (in module util)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#psp.PSPInterface.redirect">(psp.PSPInterface method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.register_cleanup">register_cleanup() (apache.request method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.server.register_cleanup">(apache.server method)</a></dt> - <dt><a href="pythonapi.html#apache.register_cleanup">(in module apache)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.register_input_filter">register_input_filter() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.register_output_filter">register_output_filter() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.remaining">remaining (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#index-14">REMOTE_ADDR</a>, <a href="pythonapi.html#index-16">[1]</a></dt> - <dt><a href="pythonapi.html#apache.connection.remote_addr">remote_addr (apache.connection attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#index-17">REMOTE_HOST</a></dt> - <dt><a href="pythonapi.html#apache.connection.remote_host">remote_host (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#index-19">REMOTE_IDENT</a></dt> - <dt><a href="pythonapi.html#apache.connection.remote_ip">remote_ip (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.remote_logname">remote_logname (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#index-10">REMOTE_USER</a></dt> - <dt><a href="pythonapi.html#index-2">req</a>, <a href="pythonapi.html#index-7">[1]</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.filter.req">(apache.filter attribute)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#index-7">request</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#index-1">handler</a></dt> - <dt><a href="pythonapi.html#index-2">object</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#index-9">REQUEST_METHOD</a></dt> - <dt><a href="pythonapi.html#index-7">request_rec</a></dt> - <dt><a href="pythonapi.html#apache.request.request_time">request_time (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.requires">requires() (apache.request method)</a></dt> - <dt>RFC</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-18">RFC 1413</a></dt> - <dt><a href="pythonapi.html#index-25">RFC 1867</a></dt> - <dt><a href="pythonapi.html#index-26">RFC 2109</a></dt> - <dt><a href="pythonapi.html#index-27">RFC 2694</a></dt> - <dt><a href="pythonapi.html#index-28">RFC 2965</a></dt> - <dt><a href="handlers.html#index-7">RFC 3875</a>, <a href="pythonapi.html#index-24">[1]</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#psp.PSP.run">run() (psp.PSP method)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="#"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-S.html b/doc-html/genindex-S.html deleted file mode 100644 index 548d08eea293828ea450fe073bb91783e56038c3..0000000000000000000000000000000000000000 --- a/doc-html/genindex-S.html +++ /dev/null @@ -1,160 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – S</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Session.BaseSession.save">save() (Session.BaseSession method)</a></dt> - <dt>SCRIPT_NAME</dt> - <dd><dl> - <dt><a href="handlers.html#index-5">WSGI</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.sendfile">sendfile() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.sent_bodyct">sent_bodyct (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.server">server (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.server_admin">server_admin (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.server_hostname">server_hostname (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#index-22">SERVER_NAME</a></dt> - <dt><a href="pythonapi.html#index-23">SERVER_PORT</a></dt> - <dt><a href="pythonapi.html#index-8">SERVER_PROTOCOL</a></dt> - <dt><a href="pythonapi.html#apache.server_root">server_root() (in module apache)</a></dt> - <dt><a href="pythonapi.html#module-Session">Session (module)</a></dt> - <dt><a href="pythonapi.html#Session.Session">Session() (in module Session)</a></dt> - <dt><a href="pythonapi.html#apache.request.set_content_length">set_content_length() (apache.request method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#psp.PSPInterface.set_error_page">set_error_page() (psp.PSPInterface method)</a></dt> - <dt><a href="pythonapi.html#apache.request.set_etag">set_etag() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.set_last_modified">set_last_modified() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.set_timeout">set_timeout() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#Cookie.SignedCookie">SignedCookie (class in Cookie)</a></dt> - <dt><a href="pythonapi.html#index-15">singe: mp_conn</a></dt> - <dt><a href="pythonapi.html#index-20">singe: mp_filter</a></dt> - <dt><a href="pythonapi.html#index-6">singe: table</a></dt> - <dt><a href="pythonapi.html#apache.request.ssl_var_lookup">ssl_var_lookup() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.stat">stat() (in module apache)</a></dt> - <dt><a href="pythonapi.html#apache.request.status">status (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.status_line">status_line (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.subprocess_env">subprocess_env (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="#"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-Symbols.html b/doc-html/genindex-Symbols.html deleted file mode 100644 index 80701f8213ef87eb698a056c885ff99e78fa87b9..0000000000000000000000000000000000000000 --- a/doc-html/genindex-Symbols.html +++ /dev/null @@ -1,174 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – Symbols</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt>--listen</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--listen">command line option</a></dt> - </dl></dd> - <dt>--pythonhandler</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--pythonhandler">command line option</a></dt> - </dl></dd> - <dt>--pythonoption</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--pythonoption">command line option</a></dt> - </dl></dd> - <dt>--pythonpath</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--pythonpath">command line option</a></dt> - </dl></dd> - <dt>--with-apxs</dt> - <dd><dl> - <dt><a href="installation.html#index-0">./configure</a></dt> - </dl></dd> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>--with-flex</dt> - <dd><dl> - <dt><a href="installation.html#index-5">./configure</a></dt> - </dl></dd> - <dt>--with-max-locks</dt> - <dd><dl> - <dt><a href="installation.html#index-4">./configure</a></dt> - </dl></dd> - <dt>--with-mutex-dir</dt> - <dd><dl> - <dt><a href="installation.html#index-3">./configure</a></dt> - </dl></dd> - <dt>--with-python</dt> - <dd><dl> - <dt><a href="installation.html#index-1">./configure</a></dt> - </dl></dd> - <dt>./configure</dt> - <dd><dl> - <dt><a href="installation.html#index-0">--with-apxs</a></dt> - <dt><a href="installation.html#index-5">--with-flex</a></dt> - <dt><a href="installation.html#index-4">--with-max-locks</a></dt> - <dt><a href="installation.html#index-3">--with-mutex-dir</a></dt> - <dt><a href="installation.html#index-1">--with-python</a></dt> - </dl></dd> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="#"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-T.html b/doc-html/genindex-T.html deleted file mode 100644 index f91177e79a8890c25f221cd649acb78f6bd24340..0000000000000000000000000000000000000000 --- a/doc-html/genindex-T.html +++ /dev/null @@ -1,140 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – T</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.table">table (class in apache)</a></dt> - <dt><a href="pythonapi.html#apache.request.the_request">the_request (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.timeout">timeout (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.timeout">timeout() (Session.BaseSession method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>traversal</dt> - <dd><dl> - <dt><a href="handlers.html#index-1">publisher</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#util.Field.type">type (util.Field attribute)</a></dt> - <dt><a href="pythonapi.html#util.Field.type_options">type_options (util.Field attribute)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="#"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-U.html b/doc-html/genindex-U.html deleted file mode 100644 index 2801b35993a968332bfcddeecb45f50be11c899f..0000000000000000000000000000000000000000 --- a/doc-html/genindex-U.html +++ /dev/null @@ -1,139 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – U</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Session.BaseSession.unlock">unlock() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.request.unparsed_uri">unparsed_uri (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.update_mtime">update_mtime() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.uri">uri (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.used_path_info">used_path_info (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.user">user (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.useragent_addr">useragent_addr (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.useragent_ip">useragent_ip (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#module-util">util (module)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="#"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-V.html b/doc-html/genindex-V.html deleted file mode 100644 index df57bf137293515e2bb53fd63437132add289cde..0000000000000000000000000000000000000000 --- a/doc-html/genindex-V.html +++ /dev/null @@ -1,132 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – V</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#util.Field.value">value (util.Field attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.vlist_validator">vlist_validator (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="#"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-W.html b/doc-html/genindex-W.html deleted file mode 100644 index 1a6b576bdca2a1b34593cfac06a88c0196241a93..0000000000000000000000000000000000000000 --- a/doc-html/genindex-W.html +++ /dev/null @@ -1,142 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – W</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.server.wild_names">wild_names (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.write">write() (apache.connection method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.filter.write">(apache.filter method)</a></dt> - <dt><a href="pythonapi.html#apache.request.write">(apache.request method)</a></dt> - </dl></dd> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>WSGI</dt> - <dd><dl> - <dt><a href="handlers.html#index-5">PATH_INFO</a></dt> - <dt><a href="handlers.html#index-5">SCRIPT_NAME</a></dt> - <dt><a href="handlers.html#index-3">handler</a></dt> - </dl></dd> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="#"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-_.html b/doc-html/genindex-_.html deleted file mode 100644 index 094da796643d0d8988110152a72234e6bdadbae1..0000000000000000000000000000000000000000 --- a/doc-html/genindex-_.html +++ /dev/null @@ -1,132 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index – _</h1> - -<table style="width: 100%" class="indextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt>_apache</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-5">module</a></dt> - </dl></dd> -</dl></td> -</tr></table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="#"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex-all.html b/doc-html/genindex-all.html deleted file mode 100644 index 9770fc8795f107b292c74accfa49146164bd4da0..0000000000000000000000000000000000000000 --- a/doc-html/genindex-all.html +++ /dev/null @@ -1,817 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index</h1> - - <div class="genindex-jumpbox"> - <a href="#Symbols"><strong>Symbols</strong></a> | <a href="#_"><strong>_</strong></a> | <a href="#A"><strong>A</strong></a> | <a href="#B"><strong>B</strong></a> | <a href="#C"><strong>C</strong></a> | <a href="#D"><strong>D</strong></a> | <a href="#E"><strong>E</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#H"><strong>H</strong></a> | <a href="#I"><strong>I</strong></a> | <a href="#K"><strong>K</strong></a> | <a href="#L"><strong>L</strong></a> | <a href="#M"><strong>M</strong></a> | <a href="#N"><strong>N</strong></a> | <a href="#O"><strong>O</strong></a> | <a href="#P"><strong>P</strong></a> | <a href="#Q"><strong>Q</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#T"><strong>T</strong></a> | <a href="#U"><strong>U</strong></a> | <a href="#V"><strong>V</strong></a> | <a href="#W"><strong>W</strong></a> - </div> -<h2 id="Symbols">Symbols</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt>--listen</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--listen">command line option</a></dt> - </dl></dd> - <dt>--pythonhandler</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--pythonhandler">command line option</a></dt> - </dl></dd> - <dt>--pythonoption</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--pythonoption">command line option</a></dt> - </dl></dd> - <dt>--pythonpath</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--pythonpath">command line option</a></dt> - </dl></dd> - <dt>--with-apxs</dt> - <dd><dl> - <dt><a href="installation.html#index-0">./configure</a></dt> - </dl></dd> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>--with-flex</dt> - <dd><dl> - <dt><a href="installation.html#index-5">./configure</a></dt> - </dl></dd> - <dt>--with-max-locks</dt> - <dd><dl> - <dt><a href="installation.html#index-4">./configure</a></dt> - </dl></dd> - <dt>--with-mutex-dir</dt> - <dd><dl> - <dt><a href="installation.html#index-3">./configure</a></dt> - </dl></dd> - <dt>--with-python</dt> - <dd><dl> - <dt><a href="installation.html#index-1">./configure</a></dt> - </dl></dd> - <dt>./configure</dt> - <dd><dl> - <dt><a href="installation.html#index-0">--with-apxs</a></dt> - <dt><a href="installation.html#index-5">--with-flex</a></dt> - <dt><a href="installation.html#index-4">--with-max-locks</a></dt> - <dt><a href="installation.html#index-3">--with-mutex-dir</a></dt> - <dt><a href="installation.html#index-1">--with-python</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="_">_</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt>_apache</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-5">module</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="A">A</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.connection.aborted">aborted (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.table.add">add() (apache.table method)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_cgi_vars">add_cgi_vars() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_common_vars">add_common_vars() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#Cookie.add_cookie">add_cookie() (in module Cookie)</a></dt> - <dt><a href="pythonapi.html#util.add_field">add_field() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_handler">add_handler() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_input_filter">add_input_filter() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.add_output_filter">add_output_filter() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.allow_methods">allow_methods() (apache.request method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.allow_methods">(in module apache)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.allowed">allowed (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.allowed_methods">allowed_methods (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.allowed_xmethods">allowed_xmethods (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.ap_auth_type">ap_auth_type (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#module-apache">apache (module)</a></dt> - <dt>apache configuration</dt> - <dd><dl> - <dt><a href="installation.html#index-10">LoadModule</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#httpdconf.Container.append">append() (httpdconf.Container method)</a></dt> - <dt><a href="pythonapi.html#psp.PSPInterface.apply_data">apply_data() (psp.PSPInterface method)</a></dt> - <dt><a href="installation.html#index-0">apxs</a></dt> - <dt><a href="pythonapi.html#apache.request.args">args (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.assbackwards">assbackwards (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.auth_name">auth_name() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#index-11">AUTH_TYPE</a></dt> - <dt><a href="pythonapi.html#apache.request.auth_type">auth_type() (apache.request method)</a></dt> - <dt>authentication</dt> - <dd><dl> - <dt><a href="handlers.html#index-2">publisher</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="B">B</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.connection.base_server">base_server (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession">BaseSession (class in Session)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.bytes_sent">bytes_sent (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="C">C</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.canonical_filename">canonical_filename (apache.request attribute)</a></dt> - <dt>CGI</dt> - <dd><dl> - <dt><a href="handlers.html#index-9">handler</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.chunked">chunked (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.cleanup">cleanup() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#util.clear">clear() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.clength">clength (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.client_addr">client_addr (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.client_ip">client_ip (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.filter.close">close() (apache.filter method)</a></dt> - <dt><a href="pythonapi.html#apache.filter.closed">closed (apache.filter attribute)</a></dt> - <dt>command line option</dt> - <dd><dl> - <dt><a href="commandline.html#cmdoption--listen">--listen</a></dt> - <dt><a href="commandline.html#cmdoption--pythonhandler">--pythonhandler</a></dt> - <dt><a href="commandline.html#cmdoption--pythonoption">--pythonoption</a></dt> - <dt><a href="commandline.html#cmdoption--pythonpath">--pythonpath</a></dt> - </dl></dd> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#httpdconf.Comment">Comment (class in httpdconf)</a></dt> - <dt><a href="pythonapi.html#apache.config_tree">config_tree() (in module apache)</a></dt> - <dt>connection</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-4">handler</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.connection">connection (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.construct_url">construct_url() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#httpdconf.Container">Container (class in httpdconf)</a></dt> - <dt><a href="pythonapi.html#apache.request.content_encoding">content_encoding (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.content_languages">content_languages (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.content_type">content_type (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#Cookie.Cookie">Cookie (class in Cookie)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#module-Cookie">(module)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#Session.BaseSession.created">created() (Session.BaseSession method)</a></dt> -</dl></td> -</tr></table> - -<h2 id="D">D</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Session.DbmSession">DbmSession (class in Session)</a></dt> - <dt><a href="pythonapi.html#apache.server.defn_line_number">defn_line_number (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.defn_name">defn_name (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.delete">delete() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#httpdconf.Directive">Directive (class in httpdconf)</a></dt> - <dt><a href="pythonapi.html#apache.filter.disable">disable() (apache.filter method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.discard_request_body">discard_request_body() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#psp.PSP.display_code">display_code() (psp.PSP method)</a></dt> - <dt><a href="pythonapi.html#util.Field.disposition">disposition (util.Field attribute)</a></dt> - <dt><a href="pythonapi.html#util.Field.disposition_options">disposition_options (util.Field attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.document_root">document_root() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.connection.double_reverse">double_reverse (apache.connection attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="E">E</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt>environment variable</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-11">AUTH_TYPE</a></dt> - <dt><a href="installation.html#index-2">PATH</a>, <a href="installation.html#index-6">[1]</a></dt> - <dt><a href="pythonapi.html#index-12">PATH_INFO</a></dt> - <dt><a href="pythonapi.html#index-13">QUERY_ARGS</a></dt> - <dt><a href="pythonapi.html#index-14">REMOTE_ADDR</a>, <a href="pythonapi.html#index-16">[1]</a></dt> - <dt><a href="pythonapi.html#index-17">REMOTE_HOST</a></dt> - <dt><a href="pythonapi.html#index-19">REMOTE_IDENT</a></dt> - <dt><a href="pythonapi.html#index-10">REMOTE_USER</a></dt> - <dt><a href="pythonapi.html#index-9">REQUEST_METHOD</a></dt> - <dt><a href="pythonapi.html#index-22">SERVER_NAME</a></dt> - <dt><a href="pythonapi.html#index-23">SERVER_PORT</a></dt> - <dt><a href="pythonapi.html#index-8">SERVER_PROTOCOL</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.eos_sent">eos_sent (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.err_headers_out">err_headers_out (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.server.error_fname">error_fname (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.exists_config">exists_config() (in module apache)</a></dt> - <dt><a href="pythonapi.html#apache.request.expecting_100">expecting_100 (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="F">F</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#util.Field">Field (class in util)</a></dt> - <dt><a href="pythonapi.html#util.FieldStorage">FieldStorage (class in util)</a></dt> - <dt><a href="pythonapi.html#util.Field.file">file (util.Field attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.filename">filename (apache.request attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#util.Field.filename">(util.Field attribute)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#Session.FileSession">FileSession (class in Session)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>filter</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-3">handler</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.finfo">finfo (apache.request attribute)</a></dt> - <dt><a href="installation.html#index-5">flex</a></dt> - <dt><a href="pythonapi.html#apache.filte.flush">flush() (apache.filte method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.request.flush">(apache.request method)</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="G">G</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#util.get">get() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.get_basic_auth_pw">get_basic_auth_pw() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.get_config">get_config() (apache.request method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.server.get_config">(apache.server method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#Cookie.get_cookie">get_cookie() (in module Cookie)</a></dt> - <dt><a href="pythonapi.html#Cookie.get_cookies">get_cookies() (in module Cookie)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.get_options">get_options() (apache.request method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.server.get_options">(apache.server method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.get_remote_host">get_remote_host() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#util.getfirst">getfirst() (in module util)</a></dt> - <dt><a href="pythonapi.html#util.getlist">getlist() (in module util)</a></dt> -</dl></td> -</tr></table> - -<h2 id="H">H</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="tutorial.html#index-0">handler</a></dt> - <dd><dl> - <dt><a href="handlers.html#index-9">CGI</a></dt> - <dt><a href="handlers.html#index-8">PSP</a></dt> - <dt><a href="handlers.html#index-3">WSGI</a></dt> - <dt><a href="pythonapi.html#index-4">connection</a></dt> - <dt><a href="pythonapi.html#index-3">filter</a></dt> - <dt><a href="handlers.html#index-0">publisher</a></dt> - <dt><a href="pythonapi.html#index-1">request</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.filter.handler">handler (apache.filter attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.request.handler">(apache.request attribute)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#util.has_key">has_key() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.header_only">header_only (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.headers_in">headers_in (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.headers_out">headers_out (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.hostname">hostname (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#module-httpdconf">httpdconf (module)</a></dt> -</dl></td> -</tr></table> - -<h2 id="I">I</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.connection.id">id (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.id">id() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.import_module">import_module() (in module apache)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.init_lock">init_lock() (Session.BaseSession method)</a></dt> - <dt>install</dt> - <dd><dl> - <dt><a href="installation.html#index-8">make</a></dt> - </dl></dd> - <dt>install_dso</dt> - <dd><dl> - <dt><a href="installation.html#index-9">make targets</a></dt> - </dl></dd> - <dt>install_py_lib</dt> - <dd><dl> - <dt><a href="installation.html#index-9">make targets</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.internal_redirect">internal_redirect() (apache.request method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.interpreter">interpreter (apache.request attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.interpreter">(in module apache)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#Session.BaseSession.invalidate">invalidate() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.request.is_https">is_https() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.filter.is_input">is_input (apache.filter attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.is_new">is_new() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.server.is_virtual">is_virtual (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#util.items">items() (in module util)</a></dt> -</dl></td> -</tr></table> - -<h2 id="K">K</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.server.keep_alive">keep_alive (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.keep_alive_max">keep_alive_max (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.keep_alive_timeout">keep_alive_timeout (apache.server attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.connection.keepalive">keepalive (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.keepalives">keepalives (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#util.keys">keys() (in module util)</a></dt> -</dl></td> -</tr></table> - -<h2 id="L">L</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Session.BaseSession.last_accessed">last_accessed() (Session.BaseSession method)</a></dt> - <dt><a href="installation.html#index-1">libpython.a</a></dt> - <dt><a href="pythonapi.html#apache.server.limit_req_fields">limit_req_fields (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.limit_req_fieldsize">limit_req_fieldsize (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.limit_req_line">limit_req_line (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#util.FieldStorage.list">list (util.FieldStorage attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.load">load() (Session.BaseSession method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>LoadModule</dt> - <dd><dl> - <dt><a href="installation.html#index-10">apache configuration</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.connection.local_addr">local_addr (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.local_host">local_host (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.local_ip">local_ip (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.lock">lock() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.connection.log_error">log_error() (apache.connection method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.request.log_error">(apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.server.log_error">(apache.server method)</a></dt> - <dt><a href="pythonapi.html#apache.log_error">(in module apache)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.server.loglevel">loglevel (apache.server attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="M">M</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.main">main (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#index-0">main_interpreter</a></dt> - <dt><a href="pythonapi.html#apache.main_server">main_server (in module apache)</a></dt> - <dt><a href="installation.html#index-7">make</a></dt> - <dd><dl> - <dt><a href="installation.html#index-8">install</a></dt> - </dl></dd> - <dt>make targets</dt> - <dd><dl> - <dt><a href="installation.html#index-9">install_dso</a></dt> - <dt><a href="installation.html#index-9">install_py_lib</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.make_table">make_table() (in module apache)</a></dt> - <dt><a href="pythonapi.html#Cookie.MarshalCookie">MarshalCookie (class in Cookie)</a></dt> - <dt><a href="pythonapi.html#apache.request.meets_conditions">meets_conditions() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#Session.MemorySession">MemorySession (class in Session)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.method">method (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.method_number">method_number (apache.request attribute)</a></dt> - <dt><a href="installation.html#index-10">mod_python.so</a></dt> - <dt>module</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-5">_apache</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.MODULE_MAGIC_NUMBER_MAJOR">MODULE_MAGIC_NUMBER_MAJOR (in module apache)</a></dt> - <dt><a href="pythonapi.html#apache.MODULE_MAGIC_NUMBER_MINOR">MODULE_MAGIC_NUMBER_MINOR (in module apache)</a></dt> - <dt><a href="pythonapi.html#index-21">mp_server</a></dt> - <dt><a href="pythonapi.html#apache.mpm_query">mpm_query() (in module apache)</a></dt> - <dt><a href="pythonapi.html#apache.request.mtime">mtime (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="N">N</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.filter.name">name (apache.filter attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#util.Field.name">(util.Field attribute)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.server.names">names (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.next">next (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.no_cache">no_cache (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.no_local_copy">no_local_copy (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.notes">notes (apache.connection attribute)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.request.notes">(apache.request attribute)</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="O">O</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt>object</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-2">request</a></dt> - </dl></dd> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>order</dt> - <dd><dl> - <dt><a href="directives.html#index-1">phase</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="P">P</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Cookie.Cookie.parse">parse() (Cookie.Cookie method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#Cookie.SignedCookie.parse">(Cookie.SignedCookie method)</a></dt> - <dt><a href="pythonapi.html#psp.parse">(in module psp)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#util.parse_qs">parse_qs() (in module util)</a></dt> - <dt><a href="pythonapi.html#util.parse_qsl">parse_qsl() (in module util)</a></dt> - <dt><a href="pythonapi.html#apache.request.parsed_uri">parsed_uri (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#psp.parsestring">parsestring() (in module psp)</a></dt> - <dt><a href="pythonapi.html#apache.filter.pass_on">pass_on() (apache.filter method)</a></dt> - <dt><a href="installation.html#index-2">PATH</a>, <a href="installation.html#index-6">[1]</a></dt> - <dt><a href="pythonapi.html#apache.server.path">path (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#index-12">PATH_INFO</a></dt> - <dd><dl> - <dt><a href="handlers.html#index-5">WSGI</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.path_info">path_info (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.pathlen">pathlen (apache.server attribute)</a></dt> - <dt>phase</dt> - <dd><dl> - <dt><a href="directives.html#index-1">order</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.phase">phase (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.port">port (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.prev">prev (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.proto_num">proto_num (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.protocol">protocol (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.proxyreq">proxyreq (apache.request attribute)</a></dt> - <dt>PSP</dt> - <dd><dl> - <dt><a href="handlers.html#index-8">handler</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#module-psp">psp (module)</a></dt> - <dt><a href="pythonapi.html#psp.PSPInterface">PSPInterface (class in psp)</a></dt> - <dt>publisher</dt> - <dd><dl> - <dt><a href="handlers.html#index-2">authentication</a></dt> - <dt><a href="handlers.html#index-0">handler</a></dt> - <dt><a href="handlers.html#index-1">traversal</a></dt> - </dl></dd> - <dt><a href="handlers.html#index-4">Python Enhancement Proposals!PEP 333</a>, <a href="handlers.html#index-6">[1]</a></dt> - <dt><a href="directives.html#index-0">Python*Handler Syntax</a></dt> - <dt><a href="directives.html#index-7">PythonAccessHandler</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="directives.html#index-8">PythonAuthenHandler</a></dt> - <dt><a href="directives.html#index-9">PythonAuthzHandler</a></dt> - <dt><a href="directives.html#index-25">PythonAutoReload</a></dt> - <dt><a href="directives.html#index-14">PythonCleanupHandler</a></dt> - <dt><a href="directives.html#index-17">PythonConnectionHandler</a></dt> - <dt><a href="directives.html#index-19">PythonDebug</a></dt> - <dt><a href="directives.html#index-18">PythonEnablePdb</a></dt> - <dt><a href="directives.html#index-11">PythonFixupHandler</a></dt> - <dt><a href="directives.html#index-12">PythonHandler</a></dt> - <dt><a href="directives.html#index-24">PythonHandlerModule</a></dt> - <dt><a href="directives.html#index-5">PythonHeaderParserHandler</a></dt> - <dt><a href="directives.html#index-20">PythonImport</a></dt> - <dt><a href="directives.html#index-6">PythonInitHandler</a></dt> - <dt><a href="directives.html#index-15">PythonInputFilter</a></dt> - <dt><a href="directives.html#index-22">PythonInterpPerDirective</a></dt> - <dt><a href="directives.html#index-21">PythonInterpPerDirectory</a></dt> - <dt><a href="directives.html#index-23">PythonInterpreter</a></dt> - <dt><a href="directives.html#index-13">PythonLogHandler</a></dt> - <dt><a href="directives.html#index-26">PythonOptimize</a></dt> - <dt><a href="directives.html#index-27">PythonOption</a></dt> - <dt><a href="directives.html#index-16">PythonOutputFilter</a></dt> - <dt><a href="directives.html#index-28">PythonPath</a></dt> - <dt><a href="directives.html#index-3">PythonPostReadRequestHandler</a></dt> - <dt><a href="directives.html#index-4">PythonTransHandler</a></dt> - <dt><a href="directives.html#index-10">PythonTypeHandler</a></dt> -</dl></td> -</tr></table> - -<h2 id="Q">Q</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#index-13">QUERY_ARGS</a></dt> -</dl></td> -</tr></table> - -<h2 id="R">R</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.range">range (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.read">read() (apache.connection method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.filter.read">(apache.filter method)</a></dt> - <dt><a href="pythonapi.html#apache.request.read">(apache.request method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.read_body">read_body (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.read_chunked">read_chunked (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.read_length">read_length (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.readline">readline() (apache.connection method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.filter.readline">(apache.filter method)</a></dt> - <dt><a href="pythonapi.html#apache.request.readline">(apache.request method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.readlines">readlines() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#util.redirect">redirect() (in module util)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#psp.PSPInterface.redirect">(psp.PSPInterface method)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.register_cleanup">register_cleanup() (apache.request method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.server.register_cleanup">(apache.server method)</a></dt> - <dt><a href="pythonapi.html#apache.register_cleanup">(in module apache)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.register_input_filter">register_input_filter() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.register_output_filter">register_output_filter() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.remaining">remaining (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#index-14">REMOTE_ADDR</a>, <a href="pythonapi.html#index-16">[1]</a></dt> - <dt><a href="pythonapi.html#apache.connection.remote_addr">remote_addr (apache.connection attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#index-17">REMOTE_HOST</a></dt> - <dt><a href="pythonapi.html#apache.connection.remote_host">remote_host (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#index-19">REMOTE_IDENT</a></dt> - <dt><a href="pythonapi.html#apache.connection.remote_ip">remote_ip (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.remote_logname">remote_logname (apache.connection attribute)</a></dt> - <dt><a href="pythonapi.html#index-10">REMOTE_USER</a></dt> - <dt><a href="pythonapi.html#index-2">req</a>, <a href="pythonapi.html#index-7">[1]</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.filter.req">(apache.filter attribute)</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#index-7">request</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#index-1">handler</a></dt> - <dt><a href="pythonapi.html#index-2">object</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#index-9">REQUEST_METHOD</a></dt> - <dt><a href="pythonapi.html#index-7">request_rec</a></dt> - <dt><a href="pythonapi.html#apache.request.request_time">request_time (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.requires">requires() (apache.request method)</a></dt> - <dt>RFC</dt> - <dd><dl> - <dt><a href="pythonapi.html#index-18">RFC 1413</a></dt> - <dt><a href="pythonapi.html#index-25">RFC 1867</a></dt> - <dt><a href="pythonapi.html#index-26">RFC 2109</a></dt> - <dt><a href="pythonapi.html#index-27">RFC 2694</a></dt> - <dt><a href="pythonapi.html#index-28">RFC 2965</a></dt> - <dt><a href="handlers.html#index-7">RFC 3875</a>, <a href="pythonapi.html#index-24">[1]</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#psp.PSP.run">run() (psp.PSP method)</a></dt> -</dl></td> -</tr></table> - -<h2 id="S">S</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Session.BaseSession.save">save() (Session.BaseSession method)</a></dt> - <dt>SCRIPT_NAME</dt> - <dd><dl> - <dt><a href="handlers.html#index-5">WSGI</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#apache.request.sendfile">sendfile() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.sent_bodyct">sent_bodyct (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.server">server (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.server_admin">server_admin (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.server_hostname">server_hostname (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#index-22">SERVER_NAME</a></dt> - <dt><a href="pythonapi.html#index-23">SERVER_PORT</a></dt> - <dt><a href="pythonapi.html#index-8">SERVER_PROTOCOL</a></dt> - <dt><a href="pythonapi.html#apache.server_root">server_root() (in module apache)</a></dt> - <dt><a href="pythonapi.html#module-Session">Session (module)</a></dt> - <dt><a href="pythonapi.html#Session.Session">Session() (in module Session)</a></dt> - <dt><a href="pythonapi.html#apache.request.set_content_length">set_content_length() (apache.request method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#psp.PSPInterface.set_error_page">set_error_page() (psp.PSPInterface method)</a></dt> - <dt><a href="pythonapi.html#apache.request.set_etag">set_etag() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.set_last_modified">set_last_modified() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.set_timeout">set_timeout() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#Cookie.SignedCookie">SignedCookie (class in Cookie)</a></dt> - <dt><a href="pythonapi.html#index-15">singe: mp_conn</a></dt> - <dt><a href="pythonapi.html#index-20">singe: mp_filter</a></dt> - <dt><a href="pythonapi.html#index-6">singe: table</a></dt> - <dt><a href="pythonapi.html#apache.request.ssl_var_lookup">ssl_var_lookup() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.stat">stat() (in module apache)</a></dt> - <dt><a href="pythonapi.html#apache.request.status">status (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.status_line">status_line (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.subprocess_env">subprocess_env (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="T">T</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.table">table (class in apache)</a></dt> - <dt><a href="pythonapi.html#apache.request.the_request">the_request (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.server.timeout">timeout (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#Session.BaseSession.timeout">timeout() (Session.BaseSession method)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>traversal</dt> - <dd><dl> - <dt><a href="handlers.html#index-1">publisher</a></dt> - </dl></dd> - <dt><a href="pythonapi.html#util.Field.type">type (util.Field attribute)</a></dt> - <dt><a href="pythonapi.html#util.Field.type_options">type_options (util.Field attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="U">U</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#Session.BaseSession.unlock">unlock() (Session.BaseSession method)</a></dt> - <dt><a href="pythonapi.html#apache.request.unparsed_uri">unparsed_uri (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.update_mtime">update_mtime() (apache.request method)</a></dt> - <dt><a href="pythonapi.html#apache.request.uri">uri (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.used_path_info">used_path_info (apache.request attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.user">user (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.useragent_addr">useragent_addr (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#apache.request.useragent_ip">useragent_ip (apache.request attribute)</a></dt> - <dt><a href="pythonapi.html#module-util">util (module)</a></dt> -</dl></td> -</tr></table> - -<h2 id="V">V</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#util.Field.value">value (util.Field attribute)</a></dt> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.request.vlist_validator">vlist_validator (apache.request attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="W">W</h2> -<table style="width: 100%" class="indextable genindextable"><tr> - <td style="width: 33%" valign="top"><dl> - <dt><a href="pythonapi.html#apache.server.wild_names">wild_names (apache.server attribute)</a></dt> - <dt><a href="pythonapi.html#apache.connection.write">write() (apache.connection method)</a></dt> - <dd><dl> - <dt><a href="pythonapi.html#apache.filter.write">(apache.filter method)</a></dt> - <dt><a href="pythonapi.html#apache.request.write">(apache.request method)</a></dt> - </dl></dd> -</dl></td> - <td style="width: 33%" valign="top"><dl> - <dt>WSGI</dt> - <dd><dl> - <dt><a href="handlers.html#index-5">PATH_INFO</a></dt> - <dt><a href="handlers.html#index-5">SCRIPT_NAME</a></dt> - <dt><a href="handlers.html#index-3">handler</a></dt> - </dl></dd> -</dl></td> -</tr></table> - - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="#"><strong>Full index on one page</strong></a></p> - - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/genindex.html b/doc-html/genindex.html deleted file mode 100644 index ca5332342a9fdd4440660c7d7bd79ad61df99d2a..0000000000000000000000000000000000000000 --- a/doc-html/genindex.html +++ /dev/null @@ -1,158 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="#" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1 id="index">Index</h1> - - <p>Index pages by letter:</p> - - <div class="genindex-jumpbox"> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong> - (can be huge)</a></p> - </div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - - <h4>Index</h4> - <p><a href="genindex-Symbols.html"><strong>Symbols</strong></a> - | <a href="genindex-_.html"><strong>_</strong></a> - | <a href="genindex-A.html"><strong>A</strong></a> - | <a href="genindex-B.html"><strong>B</strong></a> - | <a href="genindex-C.html"><strong>C</strong></a> - | <a href="genindex-D.html"><strong>D</strong></a> - | <a href="genindex-E.html"><strong>E</strong></a> - | <a href="genindex-F.html"><strong>F</strong></a> - | <a href="genindex-G.html"><strong>G</strong></a> - | <a href="genindex-H.html"><strong>H</strong></a> - | <a href="genindex-I.html"><strong>I</strong></a> - | <a href="genindex-K.html"><strong>K</strong></a> - | <a href="genindex-L.html"><strong>L</strong></a> - | <a href="genindex-M.html"><strong>M</strong></a> - | <a href="genindex-N.html"><strong>N</strong></a> - | <a href="genindex-O.html"><strong>O</strong></a> - | <a href="genindex-P.html"><strong>P</strong></a> - | <a href="genindex-Q.html"><strong>Q</strong></a> - | <a href="genindex-R.html"><strong>R</strong></a> - | <a href="genindex-S.html"><strong>S</strong></a> - | <a href="genindex-T.html"><strong>T</strong></a> - | <a href="genindex-U.html"><strong>U</strong></a> - | <a href="genindex-V.html"><strong>V</strong></a> - | <a href="genindex-W.html"><strong>W</strong></a> - </p> - - <p><a href="genindex-all.html"><strong>Full index on one page</strong></a></p> - - - -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="#" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/handlers.html b/doc-html/handlers.html deleted file mode 100644 index 76f54da9010e0ba85208bddf36eb17351eb53d8f..0000000000000000000000000000000000000000 --- a/doc-html/handlers.html +++ /dev/null @@ -1,510 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Standard Handlers — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Command Line Tool - mod_python" href="commandline.html" /> - <link rel="prev" title="Apache Configuration Directives" href="directives.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="commandline.html" title="Command Line Tool - mod_python" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="directives.html" title="Apache Configuration Directives" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="standard-handlers"> -<span id="handlers"></span><h1>Standard Handlers<a class="headerlink" href="#standard-handlers" title="Permalink to this headline">¶</a></h1> -<div class="section" id="publisher-handler"> -<span id="hand-pub"></span><h2>Publisher Handler<a class="headerlink" href="#publisher-handler" title="Permalink to this headline">¶</a></h2> -<p id="index-0">The <tt class="docutils literal"><span class="pre">publisher</span></tt> handler is a good way to avoid writing your own -handlers and focus on rapid application development. It was inspired -by <a class="reference external" href="http://www.zope.org/">Zope</a> ZPublisher.</p> -<div class="section" id="introduction"> -<span id="hand-pub-intro"></span><h3>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h3> -<p>To use the handler, you need the following lines in your configuration::</p> -<div class="highlight-python"><pre><Directory /some/path> - SetHandler mod_python - PythonHandler mod_python.publisher -</Directory></pre> -</div> -<p>This handler allows access to functions and variables within a module -via URL’s. For example, if you have the following module, called -<tt class="file docutils literal"><span class="pre">hello.py</span></tt>::</p> -<div class="highlight-python"><div class="highlight"><pre><span class="sd">""" Publisher example """</span> - -<span class="k">def</span> <span class="nf">say</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">what</span><span class="o">=</span><span class="s">"NOTHING"</span><span class="p">):</span> - <span class="k">return</span> <span class="s">"I am saying </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="n">what</span> -</pre></div> -</div> -<p>A URL <tt class="docutils literal"><span class="pre">http://www.mysite.com/hello.py/say</span></tt> would return -<tt class="docutils literal"><span class="pre">'I</span> <span class="pre">am</span> <span class="pre">saying</span> <span class="pre">NOTHING</span></tt>. A URL -<tt class="docutils literal"><span class="pre">http://www.mysite.com/hello.py/say?what=hello</span></tt> would -return <tt class="docutils literal"><span class="pre">'I</span> <span class="pre">am</span> <span class="pre">saying</span> <span class="pre">hello</span></tt>.</p> -</div> -<div class="section" id="the-publishing-algorithm"> -<span id="hand-pub-alg"></span><h3>The Publishing Algorithm<a class="headerlink" href="#the-publishing-algorithm" title="Permalink to this headline">¶</a></h3> -<p>The Publisher handler maps a URI directly to a Python variable or -callable object, then, respectively, returns it’s string -representation or calls it returning the string representation of the -return value.</p> -<div class="section" id="traversal"> -<span id="hand-pub-alg-trav"></span><span id="index-1"></span><h4>Traversal<a class="headerlink" href="#traversal" title="Permalink to this headline">¶</a></h4> -<p>The Publisher handler locates and imports the module specified in the -URI. The module location is determined from the <tt class="xref py py-attr docutils literal"><span class="pre">request.filename</span></tt> -attribute. Before importing, the file extension, if any, is -discarded.</p> -<p>If <tt class="xref py py-attr docutils literal"><span class="pre">request.filename</span></tt> is empty, the module name defaults to -<tt class="docutils literal"><span class="pre">'index'</span></tt>.</p> -<p>Once module is imported, the remaining part of the URI up to the -beginning of any query data (a.k.a. <tt class="xref py py-const docutils literal"><span class="pre">PATH_INFO</span></tt>) is used to find an -object within the module. The Publisher handler <em>traverses</em> the -path, one element at a time from left to right, mapping the elements -to Python object within the module.</p> -<p>If no <tt class="docutils literal"><span class="pre">path_info</span></tt> was given in the URL, the Publisher handler will use -the default value of <tt class="docutils literal"><span class="pre">'index'</span></tt>. If the last element is an object inside -a module, and the one immediately preceding it is a directory -(i.e. no module name is given), then the module name will also default -to <tt class="docutils literal"><span class="pre">'index'</span></tt>.</p> -<p>The traversal will stop and <tt class="xref py py-const docutils literal"><span class="pre">HTTP_NOT_FOUND</span></tt> will be returned to -the client if:</p> -<ul class="simple"> -<li>Any of the traversed object’s names begin with an underscore -(<tt class="docutils literal"><span class="pre">'_'</span></tt>). Use underscores to protect objects that should not be -accessible from the web.</li> -<li>A module is encountered. Published objects cannot be modules for -security reasons.</li> -</ul> -<p>If an object in the path could not be found, <tt class="xref py py-const docutils literal"><span class="pre">HTTP_NOT_FOUND</span></tt> -is returned to the client.</p> -<p>For example, given the following configuration::</p> -<div class="highlight-python"><pre>DocumentRoot /some/dir - -<Directory /some/dir> - SetHandler mod_python - PythonHandler mod_python.publisher -</Directory></pre> -</div> -<p>And the following <tt class="file docutils literal"><span class="pre">/some/dir/index.py</span></tt> file::</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">index</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="k">return</span> <span class="s">"We are in index()"</span> - -<span class="k">def</span> <span class="nf">hello</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="k">return</span> <span class="s">"We are in hello()"</span> -</pre></div> -</div> -<p>Then:</p> -<ul class="simple"> -<li><a class="reference external" href="http://www.somehost/index/index">http://www.somehost/index/index</a> will return <tt class="docutils literal"><span class="pre">'We</span> <span class="pre">are</span> <span class="pre">in</span> <span class="pre">index()'</span></tt></li> -<li><a class="reference external" href="http://www.somehost/index/">http://www.somehost/index/</a> will return <tt class="docutils literal"><span class="pre">'We</span> <span class="pre">are</span> <span class="pre">in</span> <span class="pre">index()'</span></tt></li> -<li><a class="reference external" href="http://www.somehost/index/hello">http://www.somehost/index/hello</a> will return <tt class="docutils literal"><span class="pre">'We</span> <span class="pre">are</span> <span class="pre">in</span> <span class="pre">hello()'</span></tt></li> -<li><a class="reference external" href="http://www.somehost/hello">http://www.somehost/hello</a> will return <tt class="docutils literal"><span class="pre">'We</span> <span class="pre">are</span> <span class="pre">in</span> <span class="pre">hello()'</span></tt></li> -<li><a class="reference external" href="http://www.somehost/spam">http://www.somehost/spam</a> will return <tt class="docutils literal"><span class="pre">'404</span> <span class="pre">Not</span> <span class="pre">Found'</span></tt></li> -</ul> -</div> -<div class="section" id="argument-matching-and-invocation"> -<span id="hand-pub-alg-args"></span><h4>Argument Matching and Invocation<a class="headerlink" href="#argument-matching-and-invocation" title="Permalink to this headline">¶</a></h4> -<p>Once the destination object is found, if it is callable and not a -class, the Publisher handler will get a list of arguments that the -object expects. This list is compared with names of fields from HTML -form data submitted by the client via <tt class="docutils literal"><span class="pre">POST</span></tt> or -<tt class="docutils literal"><span class="pre">GET</span></tt>. Values of fields whose names match the names of callable -object arguments will be passed as strings. Any fields whose names do -not match the names of callable argument objects will be silently dropped, -unless the destination callable object has a <tt class="docutils literal"><span class="pre">**kwargs</span></tt> style -argument, in which case fields with unmatched names will be passed in the -<tt class="docutils literal"><span class="pre">**kwargs</span></tt> argument.</p> -<p>If the destination is not callable or is a class, then its string -representation is returned to the client.</p> -</div> -<div class="section" id="authentication"> -<span id="hand-pub-alg-auth"></span><span id="index-2"></span><h4>Authentication<a class="headerlink" href="#authentication" title="Permalink to this headline">¶</a></h4> -<p>The publisher handler provides simple ways to control access to -modules and functions.</p> -<p>At every traversal step, the Publisher handler checks for presence of -<tt class="docutils literal"><span class="pre">__auth__</span></tt> and <tt class="docutils literal"><span class="pre">__access__</span></tt> attributes (in this order), as -well as <tt class="docutils literal"><span class="pre">__auth_realm__</span></tt> attribute.</p> -<p>If <tt class="docutils literal"><span class="pre">__auth__</span></tt> is found and it is callable, it will be called -with three arguments: the <tt class="docutils literal"><span class="pre">request</span></tt> object, a string containing -the user name and a string containing the password. If the return -value of -<tt class="docutils literal"><span class="pre">__auth__</span></tt> is false, then <tt class="xref py py-const docutils literal"><span class="pre">HTTP_UNAUTHORIZED</span></tt> is -returned to the client (which will usually cause a password dialog box -to appear).</p> -<p>If <tt class="xref py py-meth docutils literal"><span class="pre">__auth__()</span></tt> is a dictionary, then the user name will be -matched against the key and the password against the value associated -with this key. If the key and password do not match, -<tt class="xref py py-const docutils literal"><span class="pre">HTTP_UNAUTHORIZED</span></tt> is returned. Note that this requires -storing passwords as clear text in source code, which is not very secure.</p> -<p><tt class="docutils literal"><span class="pre">__auth__</span></tt> can also be a constant. In this case, if it is false -(i.e. <tt class="xref docutils literal"><span class="pre">None</span></tt>, <tt class="docutils literal"><span class="pre">0</span></tt>, <tt class="docutils literal"><span class="pre">""</span></tt>, etc.), then -<tt class="xref py py-const docutils literal"><span class="pre">HTTP_UNAUTHORIZED</span></tt> is returned.</p> -<p>If there exists an <tt class="docutils literal"><span class="pre">__auth_realm__</span></tt> string, it will be sent -to the client as Authorization Realm (this is the text that usually -appears at the top of the password dialog box).</p> -<p>If <tt class="docutils literal"><span class="pre">__access__</span></tt> is found and it is callable, it will be called -with two arguments: the <tt class="docutils literal"><span class="pre">request</span></tt> object and a string containing -the user name. If the return value of <tt class="docutils literal"><span class="pre">__access__</span></tt> is false, then -<tt class="xref py py-const docutils literal"><span class="pre">HTTP_FORBIDDEN</span></tt> is returned to the client.</p> -<p>If <tt class="docutils literal"><span class="pre">__access__</span></tt> is a list, then the user name will be matched -against the list elements. If the user name is not in the list, -<tt class="xref py py-const docutils literal"><span class="pre">HTTP_FORBIDDEN</span></tt> is returned.</p> -<p>Similarly to <tt class="docutils literal"><span class="pre">__auth__</span></tt>, <tt class="docutils literal"><span class="pre">__access__</span></tt> can be a constant.</p> -<p>In the example below, only user <tt class="docutils literal"><span class="pre">'eggs'</span></tt> with password <tt class="docutils literal"><span class="pre">'spam'</span></tt> -can access the <tt class="docutils literal"><span class="pre">hello</span></tt> function::</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">__auth_realm__</span> <span class="o">=</span> <span class="s">"Members only"</span> - -<span class="k">def</span> <span class="nf">__auth__</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">user</span><span class="p">,</span> <span class="n">passwd</span><span class="p">):</span> - - <span class="k">if</span> <span class="n">user</span> <span class="o">==</span> <span class="s">"eggs"</span> <span class="ow">and</span> <span class="n">passwd</span> <span class="o">==</span> <span class="s">"spam"</span> <span class="ow">or</span> \ - <span class="n">user</span> <span class="o">==</span> <span class="s">"joe"</span> <span class="ow">and</span> <span class="n">passwd</span> <span class="o">==</span> <span class="s">"eoj"</span><span class="p">:</span> - <span class="k">return</span> <span class="mi">1</span> - <span class="k">else</span><span class="p">:</span> - <span class="k">return</span> <span class="mi">0</span> - -<span class="k">def</span> <span class="nf">__access__</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">user</span><span class="p">):</span> - <span class="k">if</span> <span class="n">user</span> <span class="o">==</span> <span class="s">"eggs"</span><span class="p">:</span> - <span class="k">return</span> <span class="mi">1</span> - <span class="k">else</span><span class="p">:</span> - <span class="k">return</span> <span class="mi">0</span> - -<span class="k">def</span> <span class="nf">hello</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="k">return</span> <span class="s">"hello"</span> -</pre></div> -</div> -<p>Here is the same functionality, but using an alternative technique::</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">__auth_realm__</span> <span class="o">=</span> <span class="s">"Members only"</span> -<span class="n">__auth__</span> <span class="o">=</span> <span class="p">{</span><span class="s">"eggs"</span><span class="p">:</span><span class="s">"spam"</span><span class="p">,</span> <span class="s">"joe"</span><span class="p">:</span><span class="s">"eoj"</span><span class="p">}</span> -<span class="n">__access__</span> <span class="o">=</span> <span class="p">[</span><span class="s">"eggs"</span><span class="p">]</span> - -<span class="k">def</span> <span class="nf">hello</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="k">return</span> <span class="s">"hello"</span> -</pre></div> -</div> -<p>Since functions cannot be assigned attributes, to protect a function, -an <tt class="docutils literal"><span class="pre">__auth__</span></tt> or <tt class="docutils literal"><span class="pre">__access__</span></tt> function can be defined within -the function, e.g.::</p> -<div class="highlight-python"><pre>def sensitive(req): - - 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`</pre> -</div> -<p>Note that this technique will also work if <tt class="docutils literal"><span class="pre">__auth__</span></tt> or -<tt class="docutils literal"><span class="pre">__access__</span></tt> is a constant, but will not work is they are -a dictionary or a list.</p> -<p>The <tt class="docutils literal"><span class="pre">__auth__</span></tt> and <tt class="docutils literal"><span class="pre">__access__</span></tt> mechanisms exist -independently of the standard -<a class="reference internal" href="directives.html#dir-handlers-auh"><em>PythonAuthenHandler</em></a>. It -is possible to use, for example, the handler to authenticate, then the -<tt class="docutils literal"><span class="pre">__access__</span></tt> list to verify that the authenticated user is -allowed to a particular function.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">In order for mod_python to access <tt class="docutils literal"><span class="pre">__auth__</span></tt>, the module -containing it must first be imported. Therefore, any module-level -code will get executed during the import even if -<tt class="docutils literal"><span class="pre">__auth__</span></tt> is false. To truly protect a module from being -accessed, use other authentication mechanisms, e.g. the Apache -<tt class="docutils literal"><span class="pre">mod_auth</span></tt> or with a mod_python <a class="reference internal" href="directives.html#dir-handlers-auh"><em>PythonAuthenHandler</em></a>.</p> -</div> -</div> -</div> -<div class="section" id="form-data"> -<span id="hand-pub-form"></span><h3>Form Data<a class="headerlink" href="#form-data" title="Permalink to this headline">¶</a></h3> -<p>In the process of matching arguments, the Publisher handler creates an -instance of <a class="reference internal" href="pythonapi.html#pyapi-util-fstor"><em>FieldStorage class</em></a>. -A reference to this instance is stored in an attribute member{form} -of the <tt class="docutils literal"><span class="pre">request</span></tt> object.</p> -<p>Since a <tt class="docutils literal"><span class="pre">FieldStorage</span></tt> can only be instantiated once per -request, one must not attempt to instantiate <tt class="docutils literal"><span class="pre">FieldStorage</span></tt> when -using the Publisher handler and should use -<tt class="xref py py-attr docutils literal"><span class="pre">request.form</span></tt> instead.</p> -</div> -</div> -<div class="section" id="wsgi-handler"> -<span id="hand-wsgi"></span><h2>WSGI Handler<a class="headerlink" href="#wsgi-handler" title="Permalink to this headline">¶</a></h2> -<p id="index-3">WSGI handler can run WSGI applications as described in <span class="target" id="index-4"></span><a class="pep reference external" href="http://www.python.org/dev/peps/pep-0333"><strong>PEP 333</strong></a>.</p> -<p>Assuming there exists the following minimal WSGI app residing in a file named -<tt class="docutils literal"><span class="pre">mysite/wsgi.py</span></tt> in directory <tt class="docutils literal"><span class="pre">/path/to/mysite</span></tt> (so that the full -path to <tt class="docutils literal"><span class="pre">wsgi.py</span></tt> is <tt class="docutils literal"><span class="pre">/path/to/mysite/mysite/wsgi.py</span></tt>):</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">application</span><span class="p">(</span><span class="n">environ</span><span class="p">,</span> <span class="n">start_response</span><span class="p">):</span> - <span class="n">status</span> <span class="o">=</span> <span class="s">'200 OK'</span> - <span class="n">output</span> <span class="o">=</span> <span class="s">'Hello World!'</span> - - <span class="n">response_headers</span> <span class="o">=</span> <span class="p">[(</span><span class="s">'Content-type'</span><span class="p">,</span> <span class="s">'text/plain'</span><span class="p">),</span> - <span class="p">(</span><span class="s">'Content-Length'</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">output</span><span class="p">)))]</span> - <span class="n">start_response</span><span class="p">(</span><span class="n">status</span><span class="p">,</span> <span class="n">response_headers</span><span class="p">)</span> - - <span class="k">return</span> <span class="p">[</span><span class="n">output</span><span class="p">]</span> -</pre></div> -</div> -<p>It can be executed using the WSGI handler by adding the following to the -Apache configuration:</p> -<div class="highlight-python"><pre>PythonHandler mod_python.wsgi -PythonOption mod_python.wsgi.application mysite.wsgi -PythonPath "sys.path+['/path/to/mysite']"</pre> -</div> -<p>The above configuration will import a module named <tt class="docutils literal"><span class="pre">mysite.wsgi</span></tt> and -will look for an <tt class="docutils literal"><span class="pre">application</span></tt> callable in the module.</p> -<p>An alternative name for the callable can be specified by appending it -to the module name separated by <tt class="docutils literal"><span class="pre">'::'</span></tt>, e.g.:</p> -<div class="highlight-python"><pre>PythonOption mod_python.wsgi.application mysite.wsgi::my_application</pre> -</div> -<p>If you would like your application to appear under a base URI, it can -be specified by wrapping your configuration in a <tt class="docutils literal"><span class="pre"><Location></span></tt> -block. It can also be specified via the <tt class="docutils literal"><span class="pre">mod_python.wsgi.base_uri</span></tt> -option, but the <tt class="docutils literal"><span class="pre"><Location></span></tt> method is recommended, also because it -has a side-benefit of informing mod_python to skip the map-to-storage -processing phase and thereby improving performance.</p> -<p>For example, if you would like the above application to appear under -<tt class="docutils literal"><span class="pre">'/wsgiapps'</span></tt>, you could specify:</p> -<div class="highlight-python"><pre><Location /wsgiapps> - PythonHandler mod_python.wsgi - PythonOption mod_python.wsgi.application mysite.wsgi - PythonPath "sys.path+['/path/to/mysite']" -</Location></pre> -</div> -<p>With the above configuration, content formerly under -<tt class="docutils literal"><span class="pre">http://example.com/hello</span></tt> becomes available under -<tt class="docutils literal"><span class="pre">http://example.com/wsgiapps/hello</span></tt>.</p> -<p>If both <tt class="docutils literal"><span class="pre"><Location></span></tt> and <tt class="docutils literal"><span class="pre">mod_python.wsgi.base_uri</span></tt> exist, then -<tt class="docutils literal"><span class="pre">mod_python.wsgi.base_uri</span></tt> takes precedence. -<tt class="docutils literal"><span class="pre">mod_python.wsgi.base_uri</span></tt> cannot be <tt class="docutils literal"><span class="pre">'/'</span></tt> or end with a -<tt class="docutils literal"><span class="pre">'/'</span></tt>. “Root” (or no base_uri) is a blank string, which is the -default. (Note that it is allowed for <tt class="docutils literal"><span class="pre"><Location></span></tt> path to be -<tt class="docutils literal"><span class="pre">"/"</span></tt> or have a trailing slash, it will automatically be removed by -mod_python before computing <tt class="docutils literal"><span class="pre">PATH_INFO</span></tt>).</p> -<div class="admonition note" id="index-5"> -<p class="first admonition-title">Note</p> -<p><span class="target" id="index-6"></span><a class="pep reference external" href="http://www.python.org/dev/peps/pep-0333"><strong>PEP 333</strong></a> describes <tt class="docutils literal"><span class="pre">SCRIPT_NAME</span></tt> and <tt class="docutils literal"><span class="pre">PATH_INFO</span></tt> environment -variables which are core to the specification. Most WSGI-supporting -frameworks currently in existence use the value of <tt class="docutils literal"><span class="pre">PATH_INFO</span></tt> as the -request URI.</p> -<p>The two variable’s name and function originate in CGI -(<span class="target" id="index-7"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc3875.html"><strong>RFC 3875</strong></a>), which describes an environment wherein a script (or -any executable’s) output could be passed on by the web server as -content. A typical CGI script resides somewhere on the filesystem -to which the request URI maps. As part of serving the request the -server traverses the URI mapping each element to an element of the -filesystem path to locate the script. Once the script is found, the -portion of the URI used thus far is assigned to the <tt class="docutils literal"><span class="pre">SCRIPT_NAME</span></tt> -variable, while the remainder of the URI gets assigned to -<tt class="docutils literal"><span class="pre">PATH_INFO</span></tt>.</p> -<p>Because the relationship between Python modules and files on disk -is largely tangential, it is not very clear what exactly -<tt class="docutils literal"><span class="pre">PATH_INFO</span></tt> and <tt class="docutils literal"><span class="pre">SCRIPT_NAME</span></tt> ought to be. Even though Python -modules are most often files on disk located somewhere in the -Python path, they don’t have to be (they could be code objects -constructed on-the-fly), and their location in the filesystem has -no relationship to the URL structure at all.</p> -<p>The mismatch between CGI and WSGI results in an ambiguity which -requires that the split between the two variables be explicitely -specified, which is why <tt class="docutils literal"><span class="pre">mod_python.wsgi.base_uri</span></tt> exists. In essence -<tt class="docutils literal"><span class="pre">mod_python.wsgi.base_uri</span></tt> (or the path in surrounding -<tt class="docutils literal"><span class="pre"><Location></span></tt>) is the <tt class="docutils literal"><span class="pre">SCRIPT_NAME</span></tt> portion of the URI and -defaults to <tt class="docutils literal"><span class="pre">''</span></tt>.</p> -<p class="last">An important detail is that <tt class="docutils literal"><span class="pre">SCRIPT_NAME</span></tt> + <tt class="docutils literal"><span class="pre">PATH_INFO</span></tt> should -result in the original URI (encoding issues aside). Since -<tt class="docutils literal"><span class="pre">SCRIPT_NAME</span></tt> (in its original CGI definition) referrs to an -actual file, its name never ends with a slash. The slash, if any, -always ends up in <tt class="docutils literal"><span class="pre">PATH_INFO</span></tt>. E.g. <tt class="docutils literal"><span class="pre">/path/to/myscrip/foo/bar</span></tt> -splits into <tt class="docutils literal"><span class="pre">/path/to/myscript</span></tt> and <tt class="docutils literal"><span class="pre">/foo/bar</span></tt>. If the whole -site is served by an app or a script, then <tt class="docutils literal"><span class="pre">SCRIPT_NAME</span></tt> is a -blank string <tt class="docutils literal"><span class="pre">''</span></tt>, not a <tt class="docutils literal"><span class="pre">'/'</span></tt>.</p> -</div> -</div> -<div class="section" id="psp-handler"> -<span id="hand-psp"></span><h2>PSP Handler<a class="headerlink" href="#psp-handler" title="Permalink to this headline">¶</a></h2> -<p id="index-8">PSP handler is a handler that processes documents using the -<tt class="docutils literal"><span class="pre">PSP</span></tt> class in <tt class="docutils literal"><span class="pre">mod_python.psp</span></tt> module.</p> -<p>To use it, simply add this to your httpd configuration:</p> -<div class="highlight-python"><pre>AddHandler mod_python .psp -PythonHandler mod_python.psp</pre> -</div> -<p>For more details on the PSP syntax, see Section <a class="reference internal" href="pythonapi.html#pyapi-psp"><em>psp – Python Server Pager</em></a>.</p> -<p>If <tt class="docutils literal"><span class="pre">PythonDebug</span></tt> server configuration is <tt class="docutils literal"><span class="pre">On</span></tt>, then by -appending an underscore (<tt class="docutils literal"><span class="pre">'_'</span></tt>) to the end of the url you can get a -nice side-by-side listing of original PSP code and resulting Python -code generated by the <tt class="docutils literal"><span class="pre">psp}</span> <span class="pre">module</span></tt>. This is very useful for -debugging. You’ll need to adjust your httpd configuration::</p> -<div class="highlight-python"><pre>AddHandler mod_python .psp .psp_ -PythonHandler mod_python.psp -PythonDebug On</pre> -</div> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Leaving debug on in a production environment will allow remote users -to display source code of your PSP pages!</p> -</div> -</div> -<div class="section" id="cgi-handler"> -<span id="hand-cgi"></span><h2>CGI Handler<a class="headerlink" href="#cgi-handler" title="Permalink to this headline">¶</a></h2> -<p id="index-9">CGI handler is a handler that emulates the CGI environment under mod_python.</p> -<p>Note that this is not a <tt class="docutils literal"><span class="pre">'true'</span></tt> CGI environment in that it is -emulated at the Python level. <tt class="docutils literal"><span class="pre">stdin</span></tt> and <tt class="docutils literal"><span class="pre">stdout</span></tt> are -provided by substituting <tt class="docutils literal"><span class="pre">sys.stdin</span></tt> and <tt class="docutils literal"><span class="pre">sys.stdout</span></tt>, and -the environment is replaced by a dictionary. The implication is that -any outside programs called from within this environment via -<tt class="docutils literal"><span class="pre">os.system</span></tt>, etc. will not see the environment available to the -Python program, nor will they be able to read/write from standard -input/output with the results expected in a <tt class="docutils literal"><span class="pre">'true'</span></tt> CGI environment.</p> -<p>The handler is provided as a stepping stone for the migration of -legacy code away from CGI. It is not recommended that you settle on -using this handler as the preferred way to use mod_python for the long -term. This is because the CGI environment was not intended for -execution within threads (e.g. requires changing of current directory -with is inherently not thread-safe, so to overcome this cgihandler -maintains a thread lock which forces it to process one request at a -time in a multi-threaded server) and therefore can only be implemented -in a way that defeats many of the advantages of using mod_python in -the first place.</p> -<p>To use it, simply add this to your <tt class="file docutils literal"><span class="pre">.htaccess</span></tt> file::</p> -<div class="highlight-python"><pre>SetHandler mod_python -PythonHandler mod_python.cgihandler</pre> -</div> -<p>As of version 2.7, the cgihandler will properly reload even indirectly -imported module. This is done by saving a list of loaded modules -(sys.modules) prior to executing a CGI script, and then comparing it -with a list of imported modules after the CGI script is done. Modules -(except for whose whose __file__ attribute points to the standard -Python library location) will be deleted from sys.modules thereby -forcing Python to load them again next time the CGI script imports -them.</p> -<p>If you do not want the above behavior, edit the <tt class="file docutils literal"><span class="pre">cgihandler.py</span></tt> -file and comment out the code delimited by ###.</p> -<p>Tests show the cgihandler leaking some memory when processing a lot of -file uploads. It is still not clear what causes this. The way to work -around this is to set the Apache <tt class="docutils literal"><span class="pre">MaxRequestsPerChild</span></tt> to a non-zero -value.</p> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Standard Handlers</a><ul> -<li><a class="reference internal" href="#publisher-handler">Publisher Handler</a><ul> -<li><a class="reference internal" href="#introduction">Introduction</a></li> -<li><a class="reference internal" href="#the-publishing-algorithm">The Publishing Algorithm</a><ul> -<li><a class="reference internal" href="#traversal">Traversal</a></li> -<li><a class="reference internal" href="#argument-matching-and-invocation">Argument Matching and Invocation</a></li> -<li><a class="reference internal" href="#authentication">Authentication</a></li> -</ul> -</li> -<li><a class="reference internal" href="#form-data">Form Data</a></li> -</ul> -</li> -<li><a class="reference internal" href="#wsgi-handler">WSGI Handler</a></li> -<li><a class="reference internal" href="#psp-handler">PSP Handler</a></li> -<li><a class="reference internal" href="#cgi-handler">CGI Handler</a></li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="directives.html" - title="previous chapter">Apache Configuration Directives</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="commandline.html" - title="next chapter">Command Line Tool - mod_python</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/handlers.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="commandline.html" title="Command Line Tool - mod_python" - >next</a> |</li> - <li class="right" > - <a href="directives.html" title="Apache Configuration Directives" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/index.html b/doc-html/index.html deleted file mode 120000 index 09462298a69184b26a68b7c1cbb888ceaf0b0f61..0000000000000000000000000000000000000000 --- a/doc-html/index.html +++ /dev/null @@ -1 +0,0 @@ -contents.html \ No newline at end of file diff --git a/doc-html/installation.html b/doc-html/installation.html deleted file mode 100644 index 09817f05804f1c2bfe1bee923373fe8fe82ff214..0000000000000000000000000000000000000000 --- a/doc-html/installation.html +++ /dev/null @@ -1,395 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Installation — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Tutorial" href="tutorial.html" /> - <link rel="prev" title="Introduction" href="introduction.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="tutorial.html" title="Tutorial" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="introduction.html" title="Introduction" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="installation"> -<span id="id1"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">By far the best place to get help with installation and other issues -is the mod_python mailing list. Please take a moment to join the -mod_python mailing list by sending an e-mail with the word -“subscribe” in the subject to <a class="reference external" href="mailto:mod_python-request%40modpython.org">mod_python-request<span>@</span>modpython<span>.</span>org</a> or visit the -<a class="reference external" href="http://mailman.modpython.org/mailman/listinfo/mod_python">mod_python mailing list page</a></p> -</div> -<div class="section" id="prerequisites"> -<span id="inst-prerequisites"></span><h2>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline">¶</a></h2> -<p>In the ideal case your Operating System provides a pre-packaged -version of mod_python. If not, you will need to compile it -yourself. This version of mod_python requires:</p> -<ul class="simple"> -<li>Python 2 (2.6 and up) or Python 3 (3.3 and up).</li> -<li>Apache 2.2 or later. Apache 2.4 is highly recommended over 2.2.</li> -</ul> -<p>In order to compile mod_python you will need to have the include files -for both Apache and Python, as well as the Python library installed on -your system. If you installed Python and Apache from source, then you -already have everything needed. However, if you are using pre-packaged -software then you may need to install the “development” packages -which contain the include files and libraries necessary to compile -mod_python. Please check your OS documentation for specifics. (Hint: -look for packages named python-devel or python-dev and apache-devel or -apache-dev or httpd-dev, etc.).</p> -</div> -<div class="section" id="compiling"> -<span id="inst-compiling"></span><h2>Compiling<a class="headerlink" href="#compiling" title="Permalink to this headline">¶</a></h2> -<div class="section" id="running-configure"> -<span id="inst-configure"></span><h3>Running <tt class="file docutils literal"><span class="pre">./configure</span></tt><a class="headerlink" href="#running-configure" title="Permalink to this headline">¶</a></h3> -<p>The <tt class="file docutils literal"><span class="pre">./configure</span></tt> script will analyze your environment and -create custom Makefiles particular to your system. Aside from all the -standard autoconf stuff, <tt class="file docutils literal"><span class="pre">./configure</span></tt> does the following:</p> -<ul id="index-0"> -<li><p class="first">Finds out whether a program called <strong class="program">apxs</strong> is available. This -program is part of the standard Apache distribution, and is required -for compilation.</p> -<p>You can manually specify the location of apxs by using the -<em class="xref std std-option">with-apxs</em> option, e.g.:</p> -<div class="highlight-python"><pre>$ ./configure --with-apxs=/usr/local/apache/bin/apxs</pre> -</div> -<p>It is recommended that you specify this option.</p> -</li> -</ul> -<ul id="index-1"> -<li><p class="first">Checks your Python version and attempts to figure out where -<tt class="file docutils literal"><span class="pre">libpython</span></tt> is by looking at various parameters compiled into -your Python binary. By default, it will use the <strong class="program">python</strong> -program found in your <span class="target" id="index-2"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>.</p> -<p>If the first Python binary in the path is not suitable or not the one -desired for mod_python, you can specify an alternative location with the -<em class="xref std std-option">with-python</em> option, e.g.:</p> -<div class="highlight-python"><pre>$ ./configure --with-python=/usr/local/bin/python2.3</pre> -</div> -</li> -</ul> -<ul id="index-3"> -<li><p class="first">Sets the directory for the apache mutex locks (if the mutex -mechanism chosen by APR requires one).</p> -<p>Note: mutex locks are used only by <a class="reference internal" href="pythonapi.html#pyapi-sess"><em>mod_python Sessions</em></a> and -<a class="reference internal" href="handlers.html#hand-psp"><em>PSP</em></a> (which maintains a Session implicitly). If you’re -not using mod_python Sessions or PSP, then this setting should not -matter.</p> -<p>Default is <tt class="file docutils literal"><span class="pre">/tmp</span></tt>. The directory must exist and be -writable by the owner of the apache process.</p> -<p>Use <em class="xref std std-option">with-mutex-dir</em> option, e.g:</p> -<div class="highlight-python"><pre>$ ./configure --with-mutex-dir=/var/run/mod_python</pre> -</div> -<p>The mutex directory can also be specified at run time using -<a class="reference internal" href="directives.html#dir-other-po"><em>PythonOption</em></a> <tt class="docutils literal"><span class="pre">mod_python.mutex_directory</span></tt>. -See <a class="reference internal" href="#inst-apacheconfig"><em>Configuring Apache</em></a>.</p> -<p><em>New in version 3.3.0</em></p> -</li> -</ul> -<ul id="index-4"> -<li><p class="first">Sets the maximum number of mutex locks reserved by mod_python.</p> -<p>Note: mutex locks are used only by <a class="reference internal" href="pythonapi.html#pyapi-sess"><em>mod_python Sessions</em></a> and -<a class="reference internal" href="handlers.html#hand-psp"><em>PSP</em></a> (which maintains a Session implicitly). If you’re -not using mod_python Sessions or PSP, then this setting should not -matter.</p> -<p>The mutexes used for locking are a limited resource on some -systems. Increasing the maximum number of locks may increase performance -when using session locking. The default is 8. A reasonable number for -higher performance would be 32. -Use <em class="xref std std-option">with-max-locks</em> option, e.g:</p> -<div class="highlight-python"><pre>$ ./configure --with-max-locks=32</pre> -</div> -<p>The number of locks can also be specified at run time using -<a class="reference internal" href="directives.html#dir-other-po"><em>PythonOption</em></a> <tt class="docutils literal"><span class="pre">mod_python.mutex_locks</span></tt>. -See <a class="reference internal" href="#inst-apacheconfig"><em>Configuring Apache</em></a>.</p> -<p><em>New in version 3.2.0</em></p> -</li> -</ul> -<ul id="index-5"> -<li><p class="first">Attempts to locate <strong class="program">flex</strong> and determine its version. -If <strong class="program">flex</strong> cannot be found in your <span class="target" id="index-6"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt> <strong class="program">configure</strong> -will fail. If the wrong version is found <strong class="program">configure</strong> will generate a warning. -You can generally ignore this warning unless you need to re-create -<tt class="file docutils literal"><span class="pre">src/psp_parser.c</span></tt>.</p> -<p>The parser used by psp (See <a class="reference internal" href="pythonapi.html#pyapi-psp"><em>psp – Python Server Pager</em></a>) is written in C -generated using <strong class="program">flex</strong>. (This requires a reentrant version -of <strong class="program">flex</strong>, 2.5.31 or later).</p> -<p>If the first flex binary in the path is not suitable or not the one desired -you can specify an alternative location with the option:with-flex: -option, e.g:</p> -<div class="highlight-python"><pre>$ ./configure --with-flex=/usr/local/bin/flex</pre> -</div> -<p><em>New in version 3.2.0</em></p> -</li> -</ul> -</div> -<div class="section" id="running-make"> -<span id="inst-make"></span><h3>Running <tt class="file docutils literal"><span class="pre">make</span></tt><a class="headerlink" href="#running-make" title="Permalink to this headline">¶</a></h3> -<ul id="index-7"> -<li><p class="first">To start the build process, simply run:</p> -<div class="highlight-python"><pre>$ make</pre> -</div> -</li> -</ul> -</div> -</div> -<div class="section" id="installing"> -<span id="inst-installing"></span><h2>Installing<a class="headerlink" href="#installing" title="Permalink to this headline">¶</a></h2> -<span class="target" id="inst-makeinstall"></span><p id="index-8">Running <tt class="file docutils literal"><span class="pre">make</span> <span class="pre">install</span></tt></p> -<ul> -<li><p class="first">This part of the installation in most cases needs to be done as root:</p> -<div class="highlight-python"><pre>$ sudo make install</pre> -</div> -<ul class="simple"> -<li>This will copy the mod_python library (<tt class="file docutils literal"><span class="pre">mod_python.so</span></tt>) into your Apache -<tt class="file docutils literal"><span class="pre">libexec</span></tt> or <tt class="file docutils literal"><span class="pre">modules</span></tt> directory, where all the other modules are.</li> -<li>Lastly, it will install the Python libraries in -<tt class="file docutils literal"><span class="pre">site-packages</span></tt> and compile them.</li> -</ul> -</li> -</ul> -<div class="admonition note" id="index-9"> -<p class="first admonition-title">Note</p> -<p class="last">If you wish to selectively install just the Python libraries -or the DSO (mod_python.so) (which may not always require superuser -privileges), you can use the following <strong class="program">make</strong> targets: -<em class="xref std std-option">install_py_lib</em> and <em class="xref std std-option">install_dso</em>.</p> -</div> -</div> -<div class="section" id="configuring-apache"> -<span id="inst-apacheconfig"></span><h2>Configuring Apache<a class="headerlink" href="#configuring-apache" title="Permalink to this headline">¶</a></h2> -<ul id="index-10"> -<li><p class="first"><em>LoadModule</em></p> -<p>You need to configure Apache to load the module by adding the -following line in the Apache configuration file, usually called -<tt class="file docutils literal"><span class="pre">httpd.conf</span></tt> or <tt class="file docutils literal"><span class="pre">apache.conf</span></tt>:</p> -<div class="highlight-python"><pre>LoadModule python_module libexec/mod_python.so</pre> -</div> -<p>The actual path to <strong class="program">mod_python.so</strong> may vary, but <strong class="program">make install</strong> -should report at the very end exactly where <strong class="program">mod_python.so</strong> -was placed and how the <tt class="docutils literal"><span class="pre">LoadModule</span></tt> directive should appear.</p> -</li> -<li><p class="first">See <a class="reference internal" href="#inst-testing"><em>Testing</em></a> below for more basic configuration parameters.</p> -</li> -</ul> -</div> -<div class="section" id="testing"> -<span id="inst-testing"></span><h2>Testing<a class="headerlink" href="#testing" title="Permalink to this headline">¶</a></h2> -<ol class="arabic"> -<li><p class="first">Make a directory that would be visible on your web site, e.g. <tt class="docutils literal"><span class="pre">htdocs/test</span></tt>.</p> -</li> -<li><p class="first">Add the following configuration directives to the main server config file:</p> -<div class="highlight-python"><pre><Directory /some/directory/htdocs/test> - AddHandler mod_python .py - PythonHandler mptest - PythonDebug On -</Directory></pre> -</div> -<p>(Substitute <tt class="docutils literal"><span class="pre">/some/directory</span></tt> above for something applicable to -your system, usually your Apache ServerRoot)</p> -<p>This configuration can also be specified in an <tt class="file docutils literal"><span class="pre">.htaccess</span></tt> -file. Note that <tt class="file docutils literal"><span class="pre">.htaccess</span></tt> configuration is typically -disabled by default, to enable it in a directory specify -<tt class="docutils literal"><span class="pre">AllowOverride</span></tt> with at least <tt class="docutils literal"><span class="pre">FileInfo</span></tt>.</p> -</li> -<li><p class="first">This causes all requests for URLs ending in <tt class="docutils literal"><span class="pre">.py</span></tt> to be processed -by mod_python. Upon being handed a request, mod_python looks for -the appropriate <em>python handler</em> to handle it. Here, there is a -single <tt class="docutils literal"><span class="pre">PythonHandler</span></tt> directive defining module <tt class="docutils literal"><span class="pre">mptest</span></tt> as -the python handler to use. We’ll see next how this python handler -is defined.</p> -</li> -<li><p class="first">At this time, if you made changes to the main configuration file, -you will need to restart Apache in order for the changes to take -effect.</p> -</li> -<li><p class="first">Edit <tt class="file docutils literal"><span class="pre">mptest.py</span></tt> file in the <tt class="file docutils literal"><span class="pre">htdocs/test</span></tt> directory so -that is has the following lines (be careful when cutting and -pasting from your browser, you may end up with incorrect -indentation and a syntax error):</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="n">req</span><span class="o">.</span><span class="n">content_type</span> <span class="o">=</span> <span class="s">'text/plain'</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">)</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -</li> -<li><p class="first">Point your browser to the URL referring to the <tt class="file docutils literal"><span class="pre">mptest.py</span></tt>; -you should see <tt class="docutils literal"><span class="pre">'Hello</span> <span class="pre">World!'</span></tt>. If you didn’t - refer to the -troubleshooting section next.</p> -</li> -<li><p class="first">Note that according to the configuration written above, you can -point your browser to <em>any</em> URL ending in .py in the test -directory. Therefore pointing your browser to -<tt class="file docutils literal"><span class="pre">/test/foobar.py</span></tt> will be handled exactly the same way by -<tt class="file docutils literal"><span class="pre">mptest.py</span></tt>. This is because the code in the <tt class="docutils literal"><span class="pre">handler</span></tt> -function does not bother examining the URL and always acts the same -way no matter what the URL is.</p> -</li> -<li><p class="first">If everything worked well, move on to Chapter <a class="reference internal" href="tutorial.html#tutorial"><em>Tutorial</em></a>.</p> -</li> -</ol> -</div> -<div class="section" id="troubleshooting"> -<span id="inst-trouble"></span><h2>Troubleshooting<a class="headerlink" href="#troubleshooting" title="Permalink to this headline">¶</a></h2> -<p>There are a few things you can try to identify the problem:</p> -<ul> -<li><p class="first">Carefully study the error output, if any.</p> -</li> -<li><p class="first">Check the server error log file, it may contain useful clues.</p> -</li> -<li><p class="first">Try running Apache from the command line in single process mode:</p> -<div class="highlight-python"><pre>./httpd -X</pre> -</div> -<p>This prevents it from backgrounding itself and may provide some useful -information.</p> -</li> -<li><p class="first">Beginning with mod_python 3.2.0, you can use the mod_python.testhandler -to diagnose your configuration. Add this to your <tt class="file docutils literal"><span class="pre">httpd.conf</span></tt> file:</p> -<div class="highlight-python"><pre><Location /mpinfo> - SetHandler mod_python - PythonHandler mod_python.testhandler -</Location></pre> -</div> -<p>Now point your browser to the <tt class="file docutils literal"><span class="pre">/mpinfo</span></tt> URL -(e.g. <tt class="file docutils literal"><span class="pre">http://localhost/mpinfo</span></tt>) and note down the information given. -This will help you reporting your problem to the mod_python list.</p> -</li> -<li><p class="first">Ask on the <a class="reference external" href="http://mailman.modpython.org/mailman/listinfo/mod_python">mod_python list</a>. -Please make sure to provide specifics such as:</p> -<ul class="simple"> -<li>mod_python version.</li> -<li>Your operating system type, name and version.</li> -<li>Your Python version, and any unusual compilation options.</li> -<li>Your Apache version.</li> -<li>Relevant parts of the Apache config, .htaccess.</li> -<li>Relevant parts of the Python code.</li> -</ul> -</li> -</ul> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Installation</a><ul> -<li><a class="reference internal" href="#prerequisites">Prerequisites</a></li> -<li><a class="reference internal" href="#compiling">Compiling</a><ul> -<li><a class="reference internal" href="#running-configure">Running <tt class="file docutils literal"><span class="pre">./configure</span></tt></a></li> -<li><a class="reference internal" href="#running-make">Running <tt class="file docutils literal"><span class="pre">make</span></tt></a></li> -</ul> -</li> -<li><a class="reference internal" href="#installing">Installing</a></li> -<li><a class="reference internal" href="#configuring-apache">Configuring Apache</a></li> -<li><a class="reference internal" href="#testing">Testing</a></li> -<li><a class="reference internal" href="#troubleshooting">Troubleshooting</a></li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="introduction.html" - title="previous chapter">Introduction</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="tutorial.html" - title="next chapter">Tutorial</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/installation.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="tutorial.html" title="Tutorial" - >next</a> |</li> - <li class="right" > - <a href="introduction.html" title="Introduction" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/introduction.html b/doc-html/introduction.html deleted file mode 100644 index f7f5969fb33a7b1dbf614172ab9772a811f61acc..0000000000000000000000000000000000000000 --- a/doc-html/introduction.html +++ /dev/null @@ -1,179 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Introduction — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Installation" href="installation.html" /> - <link rel="prev" title="Mod_python Documentation" href="contents.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="installation.html" title="Installation" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="contents.html" title="Mod_python Documentation" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="introduction"> -<span id="id1"></span><h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1> -<div class="section" id="performance"> -<span id="id2"></span><h2>Performance<a class="headerlink" href="#performance" title="Permalink to this headline">¶</a></h2> -<p>One of the main advantages of mod_python is the increase in -performance over traditional CGI. Below are results of a very crude -test. The test was done on a 1.2GHz Pentium machine running Red Hat -Linux 7.3. <a class="reference external" href="http://httpd.apache.org/docs-2.0/programs/ab.html">Ab</a> -was used to poll 4 kinds of scripts, all of which imported the -standard cgi module (because this is how a typical Python cgi script -begins), then output a single word <tt class="docutils literal"><span class="pre">'Hello!'</span></tt>. The results are -based on 10000 requests with concurrency of 1:</p> -<div class="highlight-python"><pre>Standard CGI: 23 requests/s -Mod_python cgihandler: 385 requests/s -Mod_python publisher: 476 requests/s -Mod_python handler: 1203 requests/s</pre> -</div> -</div> -<div class="section" id="apache-http-server-api"> -<span id="apache-api"></span><h2>Apache HTTP Server API<a class="headerlink" href="#apache-http-server-api" title="Permalink to this headline">¶</a></h2> -<p>Apache processes requests in <em>phases</em> (i.e. read the request, parse -headers, check access, etc.). Phases are implemented by -functions called <em>handlers</em>. Traditionally, handlers are written in C -and compiled into Apache modules. Mod_python provides a way to extend -Apache functionality by writing Apache handlers in Python. For a -detailed description of the Apache request processing process, see the -<a class="reference external" href="http://httpd.apache.org/docs/2.4/developer/">Apache Developer Documentation</a>, as well as the -<a class="reference external" href="http://www.modpython.org/python10/">Mod_python - Integrating Python with Apache</a> -paper.</p> -<p>Currently only a subset of the Apache HTTP Server API is accessible -via mod_python. It was never the goal of the project to provide a 100% -coverage of the API. Rather, mod_python is focused on the most useful -parts of the API and on providing the most “Pythonic” ways of using -it.</p> -</div> -<div class="section" id="other-features"> -<span id="intro-other"></span><h2>Other Features<a class="headerlink" href="#other-features" title="Permalink to this headline">¶</a></h2> -<p>Mod_python also provides a number features that fall in the category -of web development, e.g. a parser for embedding Python in HTML -(<a class="reference internal" href="pythonapi.html#pyapi-psp"><em>psp – Python Server Pager</em></a>), a handler that maps URL space into modules and -functions (<a class="reference internal" href="handlers.html#hand-pub"><em>Publisher Handler</em></a>), support for session (<a class="reference internal" href="pythonapi.html#pyapi-sess"><em>Session – Session Management</em></a>) -and cookie (<a class="reference internal" href="pythonapi.html#pyapi-cookie"><em>Cookie – HTTP State Management</em></a>) handling.</p> -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><a class="reference external" href="http://httpd.apache.org/docs/2.4/developer/">Apache HTTP Server Developer Documentation</a></dt> -<dd>for HTTP developer information</dd> -<dt><a class="reference external" href="http://www.modpython.org/python10/">Mod_python - Integrating Python with Apache</a></dt> -<dd>for details on how mod_python interfaces with Apache HTTP Server</dd> -</dl> -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Introduction</a><ul> -<li><a class="reference internal" href="#performance">Performance</a></li> -<li><a class="reference internal" href="#apache-http-server-api">Apache HTTP Server API</a></li> -<li><a class="reference internal" href="#other-features">Other Features</a></li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="contents.html" - title="previous chapter">Mod_python Documentation</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="installation.html" - title="next chapter">Installation</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/introduction.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="installation.html" title="Installation" - >next</a> |</li> - <li class="right" > - <a href="contents.html" title="Mod_python Documentation" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/license.html b/doc-html/license.html deleted file mode 100644 index 15b040fa213166ee3807231126eee51e0df32abd..0000000000000000000000000000000000000000 --- a/doc-html/license.html +++ /dev/null @@ -1,411 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>History and License — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="About these documents" href="about.html" /> - <link rel="prev" title="Changes" href="changes.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="about.html" title="About these documents" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="changes.html" title="Changes" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="history-and-license"> -<span id="id1"></span><h1>History and License<a class="headerlink" href="#history-and-license" title="Permalink to this headline">¶</a></h1> -<div class="section" id="history"> -<h2>History<a class="headerlink" href="#history" title="Permalink to this headline">¶</a></h2> -<p>Mod_python originates from a project called -<a class="reference external" href="http://www.modpython.org/httpdapy/">Httpdapy</a> (1997). For a -long time Httpdapy was not called mod_python because Httpdapy was not -meant to be Apache-specific. Httpdapy was designed to be -cross-platform and in fact was initially written for the Netscape -server (back then it was called Nsapy (1997)).</p> -<p>Nsapy itself was based on an original concept and first code by Aaron -Watters from “Internet Programming with Python” by Aaron Watters, -Guido Van Rossum and James C. Ahlstrom, ISBN 1-55851-484-8.</p> -<p>Without Aaron’s inspiration, there would be no mod_python. Quoting -from the Httpdapy README file:</p> -<div class="highlight-none"><div class="highlight"><pre>Although Nsapy only worked with Netscape servers, it was very -generic in its design and was based on some brilliant ideas that -weren't necessarily Netscape specific. Its design is a combination -of extensibility, simplicity and efficiency that takes advantage of -many of the key benefits of Python and is totally in the spirit of -Python. -</pre></div> -</div> -<p>This excerpt from the Httpdapy README file describes well the -challenges and the solution provided by embedding Python within the -HTTP server:</p> -<div class="highlight-none"><div class="highlight"><pre>While developing my first WWW applications a few years back, I -found that using CGI for programs that need to connect to -relational databases (commercial or not) is too slow because every -hit requires loading of the interpreter executable which can be -megabytes in size, any database libraries that can themselves be -pretty big, plus, the database connection/authentication process -carries a very significant overhead because it involves things like -DNS resolutions, encryption, memory allocation, etc.. Under -pressure to speed up the application, I nearly gave up the idea of -using Python for the project and started researching other tools -that claimed to specialize in www database integration. I did not -have any faith in MS's ASP; was quite frustrated by Netscape -LiveWire's slow performance and bugginess; Cold Fusion seemed -promising, but I soon learned that writing in html-like tags makes -programs as readable as assembly. Same is true for PHP. Besides, I -*really* wanted to write things in Python. - -Around the same time the Internet Programming With Python book came -out and the chapter describing how to embed Python within Netscape -server immediately caught my attention. I used the example in my -project, and developed an improved version of what I later called -Nsapy that compiled on both Windows NT and Solaris. - -Although Nsapy only worked with Netscape servers, it was a very -intelligent generic OO design that, in the spirit of Python, that -lent itself for easy portability to other web servers. - -Incidently, the popularity of Netscape's servers was taking a turn -south, and so I set out to port Nsapy to other servers starting -with the most popular one, Apache. And so from Nsapy was born -Httpdapy. -</pre></div> -</div> -<p>...continuing this saga, yours truly later learned that writing -Httpdapy for every server is a task a little bigger and less -interesting than I originally imagined.</p> -<p>Instead, it seemed like providing a Python counterpart to the popular -Perl Apache extension mod_perl that would give Python users the same -(or better) capability would be a much more exciting thing to do.</p> -<p>And so it was done. The first release of mod_python happened in May of -2000.</p> -</div> -<div class="section" id="license"> -<h2>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h2> -<p>Licensed under the Apache License, Version 2.0 (the “License”); you -may not use this file except in compliance with the License. You may -obtain a copy of the License at</p> -<blockquote> -<div><a class="reference external" href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></div></blockquote> -<p>Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing -permissions and limitations under the License.</p> -<p>Apache License:</p> -<div class="highlight-none"><div class="highlight"><pre> Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -</pre></div> -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">History and License</a><ul> -<li><a class="reference internal" href="#history">History</a></li> -<li><a class="reference internal" href="#license">License</a></li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="changes.html" - title="previous chapter">Changes</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="about.html" - title="next chapter">About these documents</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/license.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="about.html" title="About these documents" - >next</a> |</li> - <li class="right" > - <a href="changes.html" title="Changes" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/objects.inv b/doc-html/objects.inv deleted file mode 100644 index 8e41ce365e960c873f0788090691244692c82a2c..0000000000000000000000000000000000000000 Binary files a/doc-html/objects.inv and /dev/null differ diff --git a/doc-html/py-modindex.html b/doc-html/py-modindex.html deleted file mode 100644 index 36b68823d3948d101bd63c26dc9aa86e1d9a0e02..0000000000000000000000000000000000000000 --- a/doc-html/py-modindex.html +++ /dev/null @@ -1,160 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Python Module Index — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - - - <script type="text/javascript"> - DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true; - </script> - - - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="#" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - - <h1>Python Module Index</h1> - - <div class="modindex-jumpbox"> - <a href="#cap-a"><strong>a</strong></a> | - <a href="#cap-c"><strong>c</strong></a> | - <a href="#cap-h"><strong>h</strong></a> | - <a href="#cap-p"><strong>p</strong></a> | - <a href="#cap-s"><strong>s</strong></a> | - <a href="#cap-u"><strong>u</strong></a> - </div> - - <table class="indextable modindextable" cellspacing="0" cellpadding="2"> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-a"><td></td><td> - <strong>a</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="pythonapi.html#module-apache"><tt class="xref">apache</tt></a></td><td> - <em>Access to Apache Internals.</em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-c"><td></td><td> - <strong>c</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="pythonapi.html#module-Cookie"><tt class="xref">Cookie</tt></a></td><td> - <em>HTTP State Management</em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-h"><td></td><td> - <strong>h</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="pythonapi.html#module-httpdconf"><tt class="xref">httpdconf</tt></a></td><td> - <em>HTTPd Configuration</em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-p"><td></td><td> - <strong>p</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="pythonapi.html#module-psp"><tt class="xref">psp</tt></a></td><td> - <em>Python Server Pages</em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-s"><td></td><td> - <strong>s</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="pythonapi.html#module-Session"><tt class="xref">Session</tt></a></td><td> - <em>Session Management</em></td></tr> - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap" id="cap-u"><td></td><td> - <strong>u</strong></td><td></td></tr> - <tr> - <td></td> - <td> - <a href="pythonapi.html#module-util"><tt class="xref">util</tt></a></td><td> - <em>Miscellaneous Utilities.</em></td></tr> - </table> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="#" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/pythonapi.html b/doc-html/pythonapi.html deleted file mode 100644 index 5708e9a4a219fa6ee0e1cedd178c6a5c32a41ddd..0000000000000000000000000000000000000000 --- a/doc-html/pythonapi.html +++ /dev/null @@ -1,3512 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Python API — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Apache Configuration Directives" href="directives.html" /> - <link rel="prev" title="Tutorial" href="tutorial.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="directives.html" title="Apache Configuration Directives" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="tutorial.html" title="Tutorial" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="python-api"> -<span id="pythonapi"></span><h1>Python API<a class="headerlink" href="#python-api" title="Permalink to this headline">¶</a></h1> -<div class="section" id="multiple-interpreters"> -<span id="pyapi-interps"></span><h2>Multiple Interpreters<a class="headerlink" href="#multiple-interpreters" title="Permalink to this headline">¶</a></h2> -<p>When working with mod_python, it is important to be aware of a feature -of Python that is normally not used when using the language for -writing scripts to be run from command line. (In fact, this feature is not -available from within Python itself and can only be accessed through -the <a class="reference external" href="http://www.python.org/doc/current/api/api.html">C language API</a>.) -Python C API provides the ability to create <em class="dfn">subinterpreters</em>. A -more detailed description of a subinterpreter is given in the -documentation for the -<a class="reference external" href="http://www.python.org/doc/current/api/initialization.html">Py_NewInterpreter()</a> -function. For this discussion, it will suffice to say that each -subinterpreter has its own separate namespace, not accessible from -other subinterpreters. Subinterpreters are very useful to make sure -that separate programs running under the same Apache server do not -interfere with one another.</p> -<p id="index-0">At server start-up or mod_python initialization time, mod_python -initializes the <em>main interpeter</em>. The main interpreter contains a -dictionary of subinterpreters. Initially, this dictionary is -empty. With every request, as needed, subinterpreters are created, and -references to them are stored in this dictionary. The dictionary is -keyed on a string, also known as <em>interpreter name</em>. This name can be -any string. The main interpreter is named <tt class="docutils literal"><span class="pre">'main_interpreter'</span></tt>. -The way all other interpreters are named can be controlled by -<tt class="docutils literal"><span class="pre">PythonInterp*</span></tt> directives. Default behavior is to name -interpreters using the Apache virtual server name (<tt class="docutils literal"><span class="pre">ServerName</span></tt> -directive). This means that all scripts in the same virtual server -execute in the same subinterpreter, but scripts in different virtual -servers execute in different subinterpreters with completely separate -namespaces. <a class="reference internal" href="directives.html#dir-other-ipd"><em>PythonInterpPerDirectory</em></a> and <a class="reference internal" href="directives.html#dir-other-ipdv"><em>PythonInterpPerDirective</em></a> directives -alter the naming convention to use the absolute path of the directory -being accessed, or the directory in which the <tt class="docutils literal"><span class="pre">Python*Handler</span></tt> was -encountered, respectively. <a class="reference internal" href="directives.html#dir-other-pi"><em>PythonInterpreter</em></a> can be used to force -the interpreter name to a specific string overriding any naming -conventions.</p> -<p>Once created, a subinterpreter will be reused for subsequent requests. -It is never destroyed and exists until the Apache process ends.</p> -<p>You can find out the name of the interpreter under which you’re -running by peeking at <tt class="xref py py-attr docutils literal"><span class="pre">request.interpreter</span></tt>.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">If any module is being used which has a C code component that uses -the simplified API for access to the Global Interpreter Lock (GIL) -for Python extension modules, then the interpreter name must be -forcibly set to be <tt class="docutils literal"><span class="pre">'main_interpreter'</span></tt>. This is necessary as such -a module will only work correctly if run within the context of the -first Python interpreter created by the process. If not forced to -run under the <tt class="docutils literal"><span class="pre">'main_interpreter'</span></tt>, a range of Python errors can -arise, each typically referring to code being run in <em>restricted -mode</em>.</p> -</div> -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><a class="reference external" href="http://www.python.org/doc/current/api/api.html">http://www.python.org/doc/current/api/api.html</a></dt> -<dd>Python C Language API</dd> -<dt><a class="reference external" href="http://www.python.org/peps/pep-0311.html">http://www.python.org/peps/pep-0311.html</a></dt> -<dd>PEP 0311 - Simplified Global Interpreter Lock Acquisition for Extensions</dd> -</dl> -</div> -</div> -<div class="section" id="overview-of-a-request-handler"> -<span id="pyapi-handler"></span><h2>Overview of a Request Handler<a class="headerlink" href="#overview-of-a-request-handler" title="Permalink to this headline">¶</a></h2> -<p id="index-1">A <em class="dfn">handler</em> is a function that processes a particular phase of a -request. Apache processes requests in phases - read the request, -process headers, provide content, etc. For every phase, it will call -handlers, provided by either the Apache core or one of its modules, -such as mod_python which passes control to functions provided by the -user and written in Python. A handler written in Python is not any -different from a handler written in C, and follows these rules:</p> -<p id="index-2">A handler function will always be passed a reference to a request -object. (Throughout this manual, the request object is often referred -to by the <tt class="docutils literal"><span class="pre">req</span></tt> variable.)</p> -<p>Every handler can return:</p> -<ul> -<li><p class="first"><tt class="xref py py-const docutils literal"><span class="pre">apache.OK</span></tt>, meaning this phase of the request was handled by this -handler and no errors occurred.</p> -</li> -<li><p class="first"><tt class="xref py py-const docutils literal"><span class="pre">apache.DECLINED</span></tt>, meaning this handler has not handled this -phase of the request to completion and Apache needs to look for -another handler in subsequent modules.</p> -</li> -<li><p class="first"><tt class="xref py py-const docutils literal"><span class="pre">apache.HTTP_ERROR</span></tt>, meaning an HTTP error occurred. -<em>HTTP_ERROR</em> can be any of the following:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">HTTP_CONTINUE</span> <span class="o">=</span> <span class="mi">100</span> -<span class="n">HTTP_SWITCHING_PROTOCOLS</span> <span class="o">=</span> <span class="mi">101</span> -<span class="n">HTTP_PROCESSING</span> <span class="o">=</span> <span class="mi">102</span> -<span class="n">HTTP_OK</span> <span class="o">=</span> <span class="mi">200</span> -<span class="n">HTTP_CREATED</span> <span class="o">=</span> <span class="mi">201</span> -<span class="n">HTTP_ACCEPTED</span> <span class="o">=</span> <span class="mi">202</span> -<span class="n">HTTP_NON_AUTHORITATIVE</span> <span class="o">=</span> <span class="mi">203</span> -<span class="n">HTTP_NO_CONTENT</span> <span class="o">=</span> <span class="mi">204</span> -<span class="n">HTTP_RESET_CONTENT</span> <span class="o">=</span> <span class="mi">205</span> -<span class="n">HTTP_PARTIAL_CONTENT</span> <span class="o">=</span> <span class="mi">206</span> -<span class="n">HTTP_MULTI_STATUS</span> <span class="o">=</span> <span class="mi">207</span> -<span class="n">HTTP_MULTIPLE_CHOICES</span> <span class="o">=</span> <span class="mi">300</span> -<span class="n">HTTP_MOVED_PERMANENTLY</span> <span class="o">=</span> <span class="mi">301</span> -<span class="n">HTTP_MOVED_TEMPORARILY</span> <span class="o">=</span> <span class="mi">302</span> -<span class="n">HTTP_SEE_OTHER</span> <span class="o">=</span> <span class="mi">303</span> -<span class="n">HTTP_NOT_MODIFIED</span> <span class="o">=</span> <span class="mi">304</span> -<span class="n">HTTP_USE_PROXY</span> <span class="o">=</span> <span class="mi">305</span> -<span class="n">HTTP_TEMPORARY_REDIRECT</span> <span class="o">=</span> <span class="mi">307</span> -<span class="n">HTTP_BAD_REQUEST</span> <span class="o">=</span> <span class="mi">400</span> -<span class="n">HTTP_UNAUTHORIZED</span> <span class="o">=</span> <span class="mi">401</span> -<span class="n">HTTP_PAYMENT_REQUIRED</span> <span class="o">=</span> <span class="mi">402</span> -<span class="n">HTTP_FORBIDDEN</span> <span class="o">=</span> <span class="mi">403</span> -<span class="n">HTTP_NOT_FOUND</span> <span class="o">=</span> <span class="mi">404</span> -<span class="n">HTTP_METHOD_NOT_ALLOWED</span> <span class="o">=</span> <span class="mi">405</span> -<span class="n">HTTP_NOT_ACCEPTABLE</span> <span class="o">=</span> <span class="mi">406</span> -<span class="n">HTTP_PROXY_AUTHENTICATION_REQUIRED</span><span class="o">=</span> <span class="mi">407</span> -<span class="n">HTTP_REQUEST_TIME_OUT</span> <span class="o">=</span> <span class="mi">408</span> -<span class="n">HTTP_CONFLICT</span> <span class="o">=</span> <span class="mi">409</span> -<span class="n">HTTP_GONE</span> <span class="o">=</span> <span class="mi">410</span> -<span class="n">HTTP_LENGTH_REQUIRED</span> <span class="o">=</span> <span class="mi">411</span> -<span class="n">HTTP_PRECONDITION_FAILED</span> <span class="o">=</span> <span class="mi">412</span> -<span class="n">HTTP_REQUEST_ENTITY_TOO_LARGE</span> <span class="o">=</span> <span class="mi">413</span> -<span class="n">HTTP_REQUEST_URI_TOO_LARGE</span> <span class="o">=</span> <span class="mi">414</span> -<span class="n">HTTP_UNSUPPORTED_MEDIA_TYPE</span> <span class="o">=</span> <span class="mi">415</span> -<span class="n">HTTP_RANGE_NOT_SATISFIABLE</span> <span class="o">=</span> <span class="mi">416</span> -<span class="n">HTTP_EXPECTATION_FAILED</span> <span class="o">=</span> <span class="mi">417</span> -<span class="n">HTTP_UNPROCESSABLE_ENTITY</span> <span class="o">=</span> <span class="mi">422</span> -<span class="n">HTTP_LOCKED</span> <span class="o">=</span> <span class="mi">423</span> -<span class="n">HTTP_FAILED_DEPENDENCY</span> <span class="o">=</span> <span class="mi">424</span> -<span class="n">HTTP_INTERNAL_SERVER_ERROR</span> <span class="o">=</span> <span class="mi">500</span> -<span class="n">HTTP_NOT_IMPLEMENTED</span> <span class="o">=</span> <span class="mi">501</span> -<span class="n">HTTP_BAD_GATEWAY</span> <span class="o">=</span> <span class="mi">502</span> -<span class="n">HTTP_SERVICE_UNAVAILABLE</span> <span class="o">=</span> <span class="mi">503</span> -<span class="n">HTTP_GATEWAY_TIME_OUT</span> <span class="o">=</span> <span class="mi">504</span> -<span class="n">HTTP_VERSION_NOT_SUPPORTED</span> <span class="o">=</span> <span class="mi">505</span> -<span class="n">HTTP_VARIANT_ALSO_VARIES</span> <span class="o">=</span> <span class="mi">506</span> -<span class="n">HTTP_INSUFFICIENT_STORAGE</span> <span class="o">=</span> <span class="mi">507</span> -<span class="n">HTTP_NOT_EXTENDED</span> <span class="o">=</span> <span class="mi">510</span> -</pre></div> -</div> -</li> -</ul> -<p>As an alternative to <em>returning</em> an HTTP error code, handlers can -signal an error by <em>raising</em> the <tt class="xref py py-const docutils literal"><span class="pre">apache.SERVER_RETURN</span></tt> -exception, and providing an HTTP error code as the exception value, -e.g.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">raise</span> <span class="n">apache</span><span class="o">.</span><span class="n">SERVER_RETURN</span><span class="p">,</span> <span class="n">apache</span><span class="o">.</span><span class="n">HTTP_FORBIDDEN</span> -</pre></div> -</div> -<p>Handlers can send content to the client using the <tt class="xref py py-meth docutils literal"><span class="pre">request.write()</span></tt> -method.</p> -<p>Client data, such as POST requests, can be read by using the -<tt class="xref py py-meth docutils literal"><span class="pre">request.read()</span></tt> function.</p> -<p>An example of a minimalistic handler might be:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">requesthandler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="n">req</span><span class="o">.</span><span class="n">content_type</span> <span class="o">=</span> <span class="s">"text/plain"</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">)</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -</div> -<div class="section" id="overview-of-a-filter-handler"> -<span id="pyapi-filter"></span><h2>Overview of a Filter Handler<a class="headerlink" href="#overview-of-a-filter-handler" title="Permalink to this headline">¶</a></h2> -<p id="index-3">A <em class="dfn">filter handler</em> is a function that can alter the input or the -output of the server. There are two kinds of filters - <em class="dfn">input</em> and -<em class="dfn">output</em> that apply to input from the client and output to the -client respectively.</p> -<p>At this time mod_python supports only request-level filters, meaning -that only the body of HTTP request or response can be filtered. Apache -provides support for connection-level filters, which will be supported -in the future.</p> -<p>A filter handler receives a <em>filter</em> object as its argument. The -request object is available as well via <tt class="docutils literal"><span class="pre">filter.req</span></tt>, but all -writing and reading should be done via the filter’s object read and -write methods.</p> -<p>Filters need to be closed when a read operation returns None -(indicating End-Of-Stream).</p> -<p>The return value of a filter is ignored. Filters cannot decline -processing like handlers, but the same effect can be achieved -by using the <tt class="xref py py-meth docutils literal"><span class="pre">filter.pass_on()</span></tt> method.</p> -<p>Filters must first be registered using <tt class="docutils literal"><span class="pre">PythonInputFilter</span></tt> or -<tt class="docutils literal"><span class="pre">PythonOutputFilter</span></tt>, then added using the Apache -<tt class="docutils literal"><span class="pre">Add/SetInputFilter</span></tt> or <tt class="docutils literal"><span class="pre">Add/SetOutputFilter</span></tt> directives.</p> -<p>Here is an example of how to specify an output filter, it tells the -server that all .py files should processed by CAPITALIZE filter:</p> -<div class="highlight-python"><pre>PythonOutputFilter capitalize CAPITALIZE -AddOutputFilter CAPITALIZE .py</pre> -</div> -<p>And here is what the code for the <tt class="file docutils literal"><span class="pre">capitalize.py</span></tt> might look -like:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">outputfilter</span><span class="p">(</span><span class="nb">filter</span><span class="p">):</span> - - <span class="n">s</span> <span class="o">=</span> <span class="nb">filter</span><span class="o">.</span><span class="n">read</span><span class="p">()</span> - <span class="k">while</span> <span class="n">s</span><span class="p">:</span> - <span class="nb">filter</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">s</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> - <span class="n">s</span> <span class="o">=</span> <span class="nb">filter</span><span class="o">.</span><span class="n">read</span><span class="p">()</span> - - <span class="k">if</span> <span class="n">s</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span> - <span class="nb">filter</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> -</pre></div> -</div> -<p>When writing filters, keep in mind that a filter will be called any -time anything upstream requests an IO operation, and the filter has no -control over the amount of data passed through it and no notion of -where in the request processing it is called. For example, within a -single request, a filter may be called once or five times, and there -is no way for the filter to know beforehand that the request is over -and which of calls is last or first for this request, thought -encounter of an EOS (None returned from a read operation) is a fairly -strong indication of an end of a request.</p> -<p>Also note that filters may end up being called recursively in -subrequests. To avoid the data being altered more than once, always -make sure you are not in a subrequest by examining the <tt class="xref py py-attr docutils literal"><span class="pre">request.main</span></tt> -value.</p> -<p>For more information on filters, see <a class="reference external" href="http://httpd.apache.org/docs-2.4/developer/filters.html">http://httpd.apache.org/docs-2.4/developer/filters.html</a>.</p> -</div> -<div class="section" id="overview-of-a-connection-handler"> -<span id="pyapi-conn"></span><h2>Overview of a Connection Handler<a class="headerlink" href="#overview-of-a-connection-handler" title="Permalink to this headline">¶</a></h2> -<p id="index-4">A <em class="dfn">connection handler</em> handles the connection, starting almost -immediately from the point the TCP connection to the server was -made.</p> -<p>Unlike HTTP handlers, connection handlers receive a <em>connection</em> -object as an argument.</p> -<p>Connection handlers can be used to implement protocols. Here is an -example of a simple echo server:</p> -<p>Apache configuration:</p> -<div class="highlight-python"><pre>PythonConnectionHandler echo</pre> -</div> -<p>Contents of <tt class="file docutils literal"><span class="pre">echo.py</span></tt> file:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">connectionhandler</span><span class="p">(</span><span class="n">conn</span><span class="p">):</span> - - <span class="k">while</span> <span class="mi">1</span><span class="p">:</span> - <span class="n">conn</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">conn</span><span class="o">.</span><span class="n">readline</span><span class="p">())</span> - - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -</div> -<div class="section" id="module-apache"> -<span id="apache-access-to-apache-internals"></span><h2><a class="reference internal" href="#module-apache" title="apache: Access to Apache Internals."><tt class="xref py py-mod docutils literal"><span class="pre">apache</span></tt></a> – Access to Apache Internals.<a class="headerlink" href="#module-apache" title="Permalink to this headline">¶</a></h2> -<p>The Python interface to Apache internals is contained in a module -appropriately named <a class="reference internal" href="#module-apache" title="apache: Access to Apache Internals."><tt class="xref py py-mod docutils literal"><span class="pre">apache</span></tt></a>, located inside the -<tt class="xref py py-mod docutils literal"><span class="pre">mod_python</span></tt> package. This module provides some important -objects that map to Apache internal structures, as well as some useful -functions, all documented below. (The request object also provides an -interface to Apache internals, it is covered in its own section of -this manual.)</p> -<p id="index-5">The <a class="reference internal" href="#module-apache" title="apache: Access to Apache Internals."><tt class="xref py py-mod docutils literal"><span class="pre">apache</span></tt></a> module can only be imported by a script running -under mod_python. This is because it depends on a built-in module -<tt class="xref py py-mod docutils literal"><span class="pre">_apache</span></tt> provided by mod_python.</p> -<p>It is best imported like this:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> -</pre></div> -</div> -<p><tt class="xref py py-mod docutils literal"><span class="pre">mod_python.apache</span></tt> module defines the following functions and -objects. For a more in-depth look at Apache internals, see the -<a class="reference external" href="http://httpd.apache.org/dev/">Apache Developer Page</a></p> -<div class="section" id="functions"> -<span id="pyapi-apmeth"></span><h3>Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h3> -<dl class="function"> -<dt id="apache.log_error"> -<tt class="descclassname">apache.</tt><tt class="descname">log_error</tt><big>(</big><em>message</em><span class="optional">[</span>, <em>level</em><span class="optional">[</span>, <em>server</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.log_error" title="Permalink to this definition">¶</a></dt> -<dd><blockquote> -<div><p>An interface to the Apache <tt class="docutils literal"><span class="pre">ap_log_error()</span></tt> -function. <em>message</em> is a string with the error message, -<em>level</em> is one of the following flags constants:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">APLOG_EMERG</span> -<span class="n">APLOG_ALERT</span> -<span class="n">APLOG_CRIT</span> -<span class="n">APLOG_ERR</span> -<span class="n">APLOG_WARNING</span> -<span class="n">APLOG_NOTICE</span> -<span class="n">APLOG_INFO</span> -<span class="n">APLOG_DEBUG</span> -<span class="n">APLOG_NOERRNO</span> <span class="o">//</span> <span class="n">DEPRECATED</span> -</pre></div> -</div> -</div></blockquote> -<p><em>server</em> is a reference to a <a class="reference internal" href="#apache.request.server" title="apache.request.server"><tt class="xref py py-meth docutils literal"><span class="pre">request.server()</span></tt></a> object. If -<em>server</em> is not specified, then the error will be logged to the -default error log, otherwise it will be written to the error log for -the appropriate virtual server. When <em>server</em> is not specified, -the setting of LogLevel does not apply, the LogLevel is dictated by -an httpd compile-time default, usually <tt class="docutils literal"><span class="pre">warn</span></tt>.</p> -<p>If you have a reference to a request object available, consider using -<a class="reference internal" href="#apache.request.log_error" title="apache.request.log_error"><tt class="xref py py-meth docutils literal"><span class="pre">request.log_error()</span></tt></a> instead, it will prepend request-specific -information such as the source IP of the request to the log entry.</p> -</dd></dl> - -<dl class="function"> -<dt id="apache.import_module"> -<tt class="descclassname">apache.</tt><tt class="descname">import_module</tt><big>(</big><em>module_name</em><span class="optional">[</span>, <em>autoreload=1</em>, <em>log=0</em>, <em>path=None</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.import_module" title="Permalink to this definition">¶</a></dt> -<dd><p>This function can be used to import modules taking advantage of -mod_python’s internal mechanism which reloads modules automatically -if they have changed since last import.</p> -<p><em>module_name</em> is a string containing the module name (it can -contain dots, e.g. <tt class="docutils literal"><span class="pre">mypackage.mymodule</span></tt>); <em>autoreload</em> indicates -whether the module should be reloaded if it has changed since last -import; when <em>log</em> is true, a message will be written to the -logs when a module is reloaded; <em>path</em> allows restricting -modules to specific paths.</p> -<p>Example:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> -<span class="n">module</span> <span class="o">=</span> <span class="n">apache</span><span class="o">.</span><span class="n">import_module</span><span class="p">(</span><span class="s">'module_name'</span><span class="p">,</span> <span class="n">log</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="function"> -<dt id="apache.allow_methods"> -<tt class="descclassname">apache.</tt><tt class="descname">allow_methods</tt><big>(</big><span class="optional">[</span><em>*args</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.allow_methods" title="Permalink to this definition">¶</a></dt> -<dd><p>A convenience function to set values in <a class="reference internal" href="#apache.request.allowed" title="apache.request.allowed"><tt class="xref py py-meth docutils literal"><span class="pre">request.allowed()</span></tt></a>. -<a class="reference internal" href="#apache.request.allowed" title="apache.request.allowed"><tt class="xref py py-meth docutils literal"><span class="pre">request.allowed()</span></tt></a> is a bitmask that is used to construct the -<tt class="docutils literal"><span class="pre">'Allow:'</span></tt> header. It should be set before returning a -<tt class="xref py py-const docutils literal"><span class="pre">HTTP_NOT_IMPLEMENTED</span></tt> error.</p> -<p>Arguments can be one or more of the following:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">M_GET</span> -<span class="n">M_PUT</span> -<span class="n">M_POST</span> -<span class="n">M_DELETE</span> -<span class="n">M_CONNECT</span> -<span class="n">M_OPTIONS</span> -<span class="n">M_TRACE</span> -<span class="n">M_PATCH</span> -<span class="n">M_PROPFIND</span> -<span class="n">M_PROPPATCH</span> -<span class="n">M_MKCOL</span> -<span class="n">M_COPY</span> -<span class="n">M_MOVE</span> -<span class="n">M_LOCK</span> -<span class="n">M_UNLOCK</span> -<span class="n">M_VERSION_CONTROL</span> -<span class="n">M_CHECKOUT</span> -<span class="n">M_UNCHECKOUT</span> -<span class="n">M_CHECKIN</span> -<span class="n">M_UPDATE</span> -<span class="n">M_LABEL</span> -<span class="n">M_REPORT</span> -<span class="n">M_MKWORKSPACE</span> -<span class="n">M_MKACTIVITY</span> -<span class="n">M_BASELINE_CONTROL</span> -<span class="n">M_MERGE</span> -<span class="n">M_INVALID</span> -</pre></div> -</div> -</dd></dl> - -<dl class="function"> -<dt id="apache.exists_config"> -<tt class="descclassname">apache.</tt><tt class="descname">exists_config</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#apache.exists_config" title="Permalink to this definition">¶</a></dt> -<dd><p>This function returns True if the Apache server was launched with -the definition with the given <em>name</em>. This means that you can -test whether Apache was launched with the <tt class="docutils literal"><span class="pre">-DFOOBAR</span></tt> parameter -by calling <tt class="docutils literal"><span class="pre">apache.exists_config_define('FOOBAR')</span></tt>.</p> -</dd></dl> - -<dl class="function"> -<dt id="apache.stat"> -<tt class="descclassname">apache.</tt><tt class="descname">stat</tt><big>(</big><em>fname</em>, <em>wanted</em><big>)</big><a class="headerlink" href="#apache.stat" title="Permalink to this definition">¶</a></dt> -<dd><p>This function returns an instance of an <tt class="docutils literal"><span class="pre">mp_finfo</span></tt> object -describing information related to the file with name <tt class="docutils literal"><span class="pre">fname</span></tt>. -The <tt class="docutils literal"><span class="pre">wanted</span></tt> argument describes the minimum attributes which -should be filled out. The resultant object can be assigned to the -<a class="reference internal" href="#apache.request.finfo" title="apache.request.finfo"><tt class="xref py py-attr docutils literal"><span class="pre">request.finfo</span></tt></a> attribute.</p> -</dd></dl> - -<dl class="function"> -<dt id="apache.register_cleanup"> -<tt class="descclassname">apache.</tt><tt class="descname">register_cleanup</tt><big>(</big><em>callable</em><span class="optional">[</span>, <em>data</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.register_cleanup" title="Permalink to this definition">¶</a></dt> -<dd><p>Registers a cleanup that will be performed at child shutdown -time. Equivalent to <a class="reference internal" href="#apache.server.register_cleanup" title="apache.server.register_cleanup"><tt class="xref py py-func docutils literal"><span class="pre">server.register_cleanup()</span></tt></a>, except -that a request object is not required. <em>Warning:</em> do not pass -directly or indirectly a request object in the data -parameter. Since the callable will be called at server shutdown -time, the request object won’t exist anymore and any manipulation -of it in the handler will give undefined behaviour.</p> -</dd></dl> - -<dl class="function"> -<dt id="apache.config_tree"> -<tt class="descclassname">apache.</tt><tt class="descname">config_tree</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.config_tree" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns the server-level configuration tree. This tree does not -include directives from .htaccess files. This is a <em>copy</em> of the -tree, modifying it has no effect on the actual configuration.</p> -</dd></dl> - -<dl class="function"> -<dt id="apache.server_root"> -<tt class="descclassname">apache.</tt><tt class="descname">server_root</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.server_root" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns the value of ServerRoot.</p> -</dd></dl> - -<dl class="function"> -<dt id="apache.make_table"> -<tt class="descclassname">apache.</tt><tt class="descname">make_table</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.make_table" title="Permalink to this definition">¶</a></dt> -<dd><p>This function is obsolete and is an alias to <a class="reference internal" href="#apache.table" title="apache.table"><tt class="xref py py-class docutils literal"><span class="pre">table</span></tt></a> (see below).</p> -</dd></dl> - -<dl class="function"> -<dt id="apache.mpm_query"> -<tt class="descclassname">apache.</tt><tt class="descname">mpm_query</tt><big>(</big><em>code</em><big>)</big><a class="headerlink" href="#apache.mpm_query" title="Permalink to this definition">¶</a></dt> -<dd><p>Allows querying of the MPM for various parameters such as numbers of -processes and threads. The return value is one of three constants:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">AP_MPMQ_NOT_SUPPORTED</span> <span class="o">=</span> <span class="mi">0</span> <span class="c"># This value specifies whether</span> - <span class="c"># an MPM is capable of</span> - <span class="c"># threading or forking.</span> -<span class="n">AP_MPMQ_STATIC</span> <span class="o">=</span> <span class="mi">1</span> <span class="c"># This value specifies whether</span> - <span class="c"># an MPM is using a static # of</span> - <span class="c"># threads or daemons.</span> -<span class="n">AP_MPMQ_DYNAMIC</span> <span class="o">=</span> <span class="mi">2</span> <span class="c"># This value specifies whether</span> - <span class="c"># an MPM is using a dynamic # of</span> - <span class="c"># threads or daemons.</span> -</pre></div> -</div> -<p>The <em>code</em> argument must be one of the following:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">AP_MPMQ_MAX_DAEMON_USED</span> <span class="o">=</span> <span class="mi">1</span> <span class="c"># Max # of daemons used so far</span> -<span class="n">AP_MPMQ_IS_THREADED</span> <span class="o">=</span> <span class="mi">2</span> <span class="c"># MPM can do threading</span> -<span class="n">AP_MPMQ_IS_FORKED</span> <span class="o">=</span> <span class="mi">3</span> <span class="c"># MPM can do forking</span> -<span class="n">AP_MPMQ_HARD_LIMIT_DAEMONS</span> <span class="o">=</span> <span class="mi">4</span> <span class="c"># The compiled max # daemons</span> -<span class="n">AP_MPMQ_HARD_LIMIT_THREADS</span> <span class="o">=</span> <span class="mi">5</span> <span class="c"># The compiled max # threads</span> -<span class="n">AP_MPMQ_MAX_THREADS</span> <span class="o">=</span> <span class="mi">6</span> <span class="c"># # of threads/child by config</span> -<span class="n">AP_MPMQ_MIN_SPARE_DAEMONS</span> <span class="o">=</span> <span class="mi">7</span> <span class="c"># Min # of spare daemons</span> -<span class="n">AP_MPMQ_MIN_SPARE_THREADS</span> <span class="o">=</span> <span class="mi">8</span> <span class="c"># Min # of spare threads</span> -<span class="n">AP_MPMQ_MAX_SPARE_DAEMONS</span> <span class="o">=</span> <span class="mi">9</span> <span class="c"># Max # of spare daemons</span> -<span class="n">AP_MPMQ_MAX_SPARE_THREADS</span> <span class="o">=</span> <span class="mi">10</span> <span class="c"># Max # of spare threads</span> -<span class="n">AP_MPMQ_MAX_REQUESTS_DAEMON</span><span class="o">=</span> <span class="mi">11</span> <span class="c"># Max # of requests per daemon</span> -<span class="n">AP_MPMQ_MAX_DAEMONS</span> <span class="o">=</span> <span class="mi">12</span> <span class="c"># Max # of daemons by config</span> -</pre></div> -</div> -<p>Example:</p> -<div class="highlight-python"><pre>if apache.mpm_query(apache.AP_MPMQ_IS_THREADED): - # do something -else: - # do something else</pre> -</div> -</dd></dl> - -</div> -<div class="section" id="attributes"> -<span id="pyapi-apmem"></span><h3>Attributes<a class="headerlink" href="#attributes" title="Permalink to this headline">¶</a></h3> -<dl class="attribute"> -<dt id="apache.interpreter"> -<tt class="descclassname">apache.</tt><tt class="descname">interpreter</tt><a class="headerlink" href="#apache.interpreter" title="Permalink to this definition">¶</a></dt> -<dd><p>String. The name of the subinterpreter under which we’re running. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.main_server"> -<tt class="descclassname">apache.</tt><tt class="descname">main_server</tt><a class="headerlink" href="#apache.main_server" title="Permalink to this definition">¶</a></dt> -<dd><p>A <tt class="docutils literal"><span class="pre">server</span></tt> object for the main server. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.MODULE_MAGIC_NUMBER_MAJOR"> -<tt class="descclassname">apache.</tt><tt class="descname">MODULE_MAGIC_NUMBER_MAJOR</tt><a class="headerlink" href="#apache.MODULE_MAGIC_NUMBER_MAJOR" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. An internal to Apache version number useful to determine whether -certain features should be available. See <a class="reference internal" href="#apache.MODULE_MAGIC_NUMBER_MINOR" title="apache.MODULE_MAGIC_NUMBER_MINOR"><tt class="xref py py-attr docutils literal"><span class="pre">MODULE_MAGIC_NUMBER_MINOR</span></tt></a>.</p> -<p>Major API changes that could cause compatibility problems for older -modules such as structure size changes. No binary compatibility is -possible across a change in the major version.</p> -<p><em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.MODULE_MAGIC_NUMBER_MINOR"> -<tt class="descclassname">apache.</tt><tt class="descname">MODULE_MAGIC_NUMBER_MINOR</tt><a class="headerlink" href="#apache.MODULE_MAGIC_NUMBER_MINOR" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. An internal to Apache version number useful to determine whether -certain features should be available. See <a class="reference internal" href="#apache.MODULE_MAGIC_NUMBER_MAJOR" title="apache.MODULE_MAGIC_NUMBER_MAJOR"><tt class="xref py py-attr docutils literal"><span class="pre">MODULE_MAGIC_NUMBER_MAJOR</span></tt></a>.</p> -<p>Minor API changes that do not cause binary compatibility problems.</p> -<p><em>(Read-Only)</em></p> -</dd></dl> - -</div> -<div class="section" id="table-object-mp-table"> -<span id="pyapi-mptable"></span><h3>Table Object (mp_table)<a class="headerlink" href="#table-object-mp-table" title="Permalink to this headline">¶</a></h3> -<span class="target" id="index-6"></span><dl class="class"> -<dt id="apache.table"> -<em class="property">class </em><tt class="descclassname">apache.</tt><tt class="descname">table</tt><big>(</big><span class="optional">[</span><em>mapping-or-sequence</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.table" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns a new empty object of type <tt class="docutils literal"><span class="pre">mp_table</span></tt>. See Section -<a class="reference internal" href="#pyapi-mptable"><em>Table Object (mp_table)</em></a> for description of the table object. The -<em>mapping-or-sequence</em> will be used to provide initial values for -the table.</p> -<p>The table object is a wrapper around the Apache APR table. The -table object behaves very much like a dictionary (including the -Python 2.2 features such as support of the <tt class="docutils literal"><span class="pre">in</span></tt> operator, etc.), -with the following differences:</p> -<ul class="simple"> -<li>Both keys and values must be strings.</li> -<li>Key lookups are case-insensitive.</li> -<li>Duplicate keys are allowed (see <a class="reference internal" href="#apache.table.add" title="apache.table.add"><tt class="xref py py-meth docutils literal"><span class="pre">table.add()</span></tt></a> below). When there is -more than one value for a key, a subscript operation returns a list.</li> -</ul> -<p>Much of the information that Apache uses is stored in tables. For -example, <a class="reference internal" href="#apache.request.headers_in" title="apache.request.headers_in"><tt class="xref py py-meth docutils literal"><span class="pre">request.headers_in()</span></tt></a> and <a class="reference internal" href="#apache.request.headers_out" title="apache.request.headers_out"><tt class="xref py py-meth docutils literal"><span class="pre">request.headers_out()</span></tt></a>.</p> -<p>All the tables that mod_python provides inside the request object -are actual mappings to the Apache structures, so changing the -Python table also changes the underlying Apache table.</p> -<p>In addition to normal dictionary-like behavior, the table object -also has the following method:</p> -<dl class="method"> -<dt id="apache.table.add"> -<tt class="descname">add</tt><big>(</big><em>key</em>, <em>val</em><big>)</big><a class="headerlink" href="#apache.table.add" title="Permalink to this definition">¶</a></dt> -<dd><p>Allows for creating duplicate keys, which is useful -when multiple headers, such as <cite>Set-Cookie:</cite> are required.</p> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="request-object"> -<span id="pyapi-mprequest"></span><h3>Request Object<a class="headerlink" href="#request-object" title="Permalink to this headline">¶</a></h3> -<p id="index-7">The request object is a Python mapping to the Apache <cite>request_rec</cite> -structure. When a handler is invoked, it is always passed a single -argument - the request object. For brevity, we often refer to it here -and throughout the code as <tt class="docutils literal"><span class="pre">req</span></tt>.</p> -<p>You can dynamically assign attributes to it as a way to communicate -between handlers.</p> -<div class="section" id="request-methods"> -<span id="pyapi-mprequest-meth"></span><h4>Request Methods<a class="headerlink" href="#request-methods" title="Permalink to this headline">¶</a></h4> -<dl class="method"> -<dt id="apache.request.add_cgi_vars"> -<tt class="descclassname">request.</tt><tt class="descname">add_cgi_vars</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.add_cgi_vars" title="Permalink to this definition">¶</a></dt> -<dd><p>Calls Apache function <tt class="docutils literal"><span class="pre">ap_add_common_vars()</span></tt> followed some code -very similar to Apache <tt class="docutils literal"><span class="pre">ap_add_cgi_vars()</span></tt> with the exception of -calculating <tt class="docutils literal"><span class="pre">PATH_TRANSLATED</span></tt> value, thereby avoiding -sub-requests and filesystem access used in the <tt class="docutils literal"><span class="pre">ap_add_cgi_vars()</span></tt> -implementation.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.add_common_vars"> -<tt class="descclassname">request.</tt><tt class="descname">add_common_vars</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.add_common_vars" title="Permalink to this definition">¶</a></dt> -<dd><p>Use of this method is discouraged, use -<a class="reference internal" href="#apache.request.add_cgi_vars" title="apache.request.add_cgi_vars"><tt class="xref py py-meth docutils literal"><span class="pre">request.add_cgi_vars()</span></tt></a> instead.</p> -<p>Calls the Apache <tt class="docutils literal"><span class="pre">ap_add_common_vars()</span></tt> function. After a call to -this method, <a class="reference internal" href="#apache.request.subprocess_env" title="apache.request.subprocess_env"><tt class="xref py py-attr docutils literal"><span class="pre">request.subprocess_env</span></tt></a> will contain <em>some</em> CGI -information.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.add_handler"> -<tt class="descclassname">request.</tt><tt class="descname">add_handler</tt><big>(</big><em>htype</em>, <em>handler</em><span class="optional">[</span>, <em>dir</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.add_handler" title="Permalink to this definition">¶</a></dt> -<dd><p>Allows dynamic handler registration. <em>htype</em> is a string -containing the name of any of the apache request (but not filter or -connection) handler directives, -e.g. <tt class="docutils literal"><span class="pre">'PythonHandler'</span></tt>. <em>handler</em> is a string containing the -name of the module and the handler function. Optional <em>dir</em> is -a string containing the name of the directory to be added to the -pythonpath. If no directory is specified, then, if there is already -a handler of the same type specified, its directory is inherited, -otherwise the directory of the presently executing handler is -used. If there is a <tt class="docutils literal"><span class="pre">'PythonPath'</span></tt> directive in effect, then -<tt class="docutils literal"><span class="pre">sys.path</span></tt> will be set exactly according to it (no directories -added, the <em>dir</em> argument is ignored).</p> -<p>A handler added this way only persists throughout the life of the -request. It is possible to register more handlers while inside the -handler of the same type. One has to be careful as to not to create -an infinite loop this way.</p> -<p>Dynamic handler registration is a useful technique that allows the -code to dynamically decide what will happen next. A typical example -might be a <tt class="docutils literal"><span class="pre">PythonAuthenHandler</span></tt> that will assign different -<tt class="docutils literal"><span class="pre">PythonHandlers</span></tt> based on the authorization level, something -like:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">if</span> <span class="n">manager</span><span class="p">:</span> - <span class="n">req</span><span class="o">.</span><span class="n">add_handler</span><span class="p">(</span><span class="s">"PythonHandler"</span><span class="p">,</span> <span class="s">"menu::admin"</span><span class="p">)</span> -<span class="k">else</span><span class="p">:</span> - <span class="n">req</span><span class="o">.</span><span class="n">add_handler</span><span class="p">(</span><span class="s">"PythonHandler"</span><span class="p">,</span> <span class="s">"menu::basic"</span><span class="p">)</span> -</pre></div> -</div> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">If you pass this function an invalid handler, an exception will be -generated at the time an attempt is made to find the handler.</p> -</div> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.add_input_filter"> -<tt class="descclassname">request.</tt><tt class="descname">add_input_filter</tt><big>(</big><em>filter_name</em><big>)</big><a class="headerlink" href="#apache.request.add_input_filter" title="Permalink to this definition">¶</a></dt> -<dd><p>Adds the named filter into the input filter chain for the current -request. The filter should be added before the first attempt to -read any data from the request.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.add_output_filter"> -<tt class="descclassname">request.</tt><tt class="descname">add_output_filter</tt><big>(</big><em>filter_name</em><big>)</big><a class="headerlink" href="#apache.request.add_output_filter" title="Permalink to this definition">¶</a></dt> -<dd><p>Adds the named filter into the output filter chain for the current -request. The filter should be added before the first attempt to -write any data for the response.</p> -<p>Provided that all data written is being buffered and not flushed, -this could be used to add the “CONTENT_LENGTH” filter into the -chain of output filters. The purpose of the “CONTENT_LENGTH” filter -is to add a <tt class="docutils literal"><span class="pre">Content-Length:</span></tt> header to the response.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">req</span><span class="o">.</span><span class="n">add_output_filter</span><span class="p">(</span><span class="s">"CONTENT_LENGTH"</span><span class="p">)</span> -<span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"content"</span><span class="p">,</span><span class="mi">0</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.allow_methods"> -<tt class="descclassname">request.</tt><tt class="descname">allow_methods</tt><big>(</big><em>methods</em><span class="optional">[</span>, <em>reset</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.allow_methods" title="Permalink to this definition">¶</a></dt> -<dd><p>Adds methods to the <a class="reference internal" href="#apache.request.allowed_methods" title="apache.request.allowed_methods"><tt class="xref py py-meth docutils literal"><span class="pre">request.allowed_methods()</span></tt></a> list. This list -will be passed in <cite>Allowed:</cite> header if -<tt class="xref py py-const docutils literal"><span class="pre">HTTP_METHOD_NOT_ALLOWED</span></tt> or <tt class="xref py py-const docutils literal"><span class="pre">HTTP_NOT_IMPLEMENTED</span></tt> -is returned to the client. Note that Apache doesn’t do anything to -restrict the methods, this list is only used to construct the -header. The actual method-restricting logic has to be provided in -the handler code.</p> -<p><em>methods</em> is a sequence of strings. If <em>reset</em> is 1, then -the list of methods is first cleared.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.auth_name"> -<tt class="descclassname">request.</tt><tt class="descname">auth_name</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.auth_name" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns AuthName setting.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.auth_type"> -<tt class="descclassname">request.</tt><tt class="descname">auth_type</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.auth_type" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns AuthType setting.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.construct_url"> -<tt class="descclassname">request.</tt><tt class="descname">construct_url</tt><big>(</big><em>uri</em><big>)</big><a class="headerlink" href="#apache.request.construct_url" title="Permalink to this definition">¶</a></dt> -<dd><p>This function returns a fully qualified URI string from the path -specified by uri, using the information stored in the request to -determine the scheme, server name and port. The port number is not -included in the string if it is the same as the default port 80.</p> -<p>For example, imagine that the current request is directed to the -virtual server www.modpython.org at port 80. Then supplying -<tt class="docutils literal"><span class="pre">'/index.html'</span></tt> will yield the string -<tt class="docutils literal"><span class="pre">'http://www.modpython.org/index.html'</span></tt>.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.discard_request_body"> -<tt class="descclassname">request.</tt><tt class="descname">discard_request_body</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.discard_request_body" title="Permalink to this definition">¶</a></dt> -<dd><p>Tests for and reads any message body in the request, simply discarding -whatever it receives.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.document_root"> -<tt class="descclassname">request.</tt><tt class="descname">document_root</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.document_root" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns DocumentRoot setting.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.get_basic_auth_pw"> -<tt class="descclassname">request.</tt><tt class="descname">get_basic_auth_pw</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.get_basic_auth_pw" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns a string containing the password when Basic authentication is -used.</p> -<p>On Python 3 the string will be decoded to Unicode using Latin1.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.get_config"> -<tt class="descclassname">request.</tt><tt class="descname">get_config</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.get_config" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns a reference to the table object containing the mod_python -configuration in effect for this request except for -<tt class="docutils literal"><span class="pre">Python*Handler</span></tt> and <tt class="docutils literal"><span class="pre">PythonOption</span></tt> (The latter can be obtained -via <a class="reference internal" href="#apache.request.get_options" title="apache.request.get_options"><tt class="xref py py-meth docutils literal"><span class="pre">request.get_options()</span></tt></a>. The table has directives as keys, -and their values, if any, as values.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.get_remote_host"> -<tt class="descclassname">request.</tt><tt class="descname">get_remote_host</tt><big>(</big><span class="optional">[</span><em>type</em><span class="optional">[</span>, <em>str_is_ip</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.get_remote_host" title="Permalink to this definition">¶</a></dt> -<dd><p>This method is used to determine remote client’s DNS name or IP -number. The first call to this function may entail a DNS look up, -but subsequent calls will use the cached result from the first -call.</p> -<p>The optional <em>type</em> argument can specify the following:</p> -<ul class="simple"> -<li><tt class="xref py py-const docutils literal"><span class="pre">apache.REMOTE_HOST</span></tt> Look up the DNS name. Return None if Apache -directive <tt class="docutils literal"><span class="pre">HostNameLookups</span></tt> is <tt class="docutils literal"><span class="pre">Off</span></tt> or the hostname cannot -be determined.</li> -<li><tt class="xref py py-const docutils literal"><span class="pre">apache.REMOTE_NAME</span></tt> <em>(Default)</em> Return the DNS name if -possible, or the IP (as a string in dotted decimal notation) -otherwise.</li> -<li><tt class="xref py py-const docutils literal"><span class="pre">apache.REMOTE_NOLOOKUP</span></tt> Don’t perform a DNS lookup, return an -IP. Note: if a lookup was performed prior to this call, then the -cached host name is returned.</li> -<li><tt class="xref py py-const docutils literal"><span class="pre">apache.REMOTE_DOUBLE_REV</span></tt> Force a double-reverse lookup. On -failure, return None.</li> -</ul> -<p>If <em>str_is_ip</em> is <tt class="xref docutils literal"><span class="pre">None</span></tt> or unspecified, then the return -value is a string representing the DNS name or IP address.</p> -<p>If the optional <em>str_is_ip</em> argument is not <tt class="xref docutils literal"><span class="pre">None</span></tt>, then -the return value is an <tt class="docutils literal"><span class="pre">(address,</span> <span class="pre">str_is_ip)</span></tt> tuple, where -<tt class="docutils literal"><span class="pre">str_is_ip</span></tt> is non-zero if <tt class="docutils literal"><span class="pre">address</span></tt> is an IP address -string.</p> -<p>On failure, <tt class="xref docutils literal"><span class="pre">None</span></tt> is returned.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.get_options"> -<tt class="descclassname">request.</tt><tt class="descname">get_options</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.get_options" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns a reference to the table object containing the options set by -the <tt class="docutils literal"><span class="pre">PythonOption</span></tt> directives.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.internal_redirect"> -<tt class="descclassname">request.</tt><tt class="descname">internal_redirect</tt><big>(</big><em>new_uri</em><big>)</big><a class="headerlink" href="#apache.request.internal_redirect" title="Permalink to this definition">¶</a></dt> -<dd><p>Internally redirects the request to the <em>new_uri</em>. <em>new_uri</em> -must be a string.</p> -<p>The httpd server handles internal redirection by creating a new -request object and processing all request phases. Within an -internal redirect, <a class="reference internal" href="#apache.request.prev" title="apache.request.prev"><tt class="xref py py-meth docutils literal"><span class="pre">request.prev()</span></tt></a> will contain a reference to a -request object from which it was redirected.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.is_https"> -<tt class="descclassname">request.</tt><tt class="descname">is_https</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.is_https" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns non-zero if the connection is using SSL/TLS. Will always return -zero if the mod_ssl Apache module is not loaded.</p> -<p>You can use this method during any request phase, unlike looking -for the <tt class="docutils literal"><span class="pre">HTTPS</span></tt> variable in the <a class="reference internal" href="#apache.request.subprocess_env" title="apache.request.subprocess_env"><tt class="xref py py-attr docutils literal"><span class="pre">request.subprocess_env</span></tt></a> member -dictionary. This makes it possible to write an authentication or -access handler that makes decisions based upon whether SSL is being -used.</p> -<p>Note that this method will not determine the quality of the -encryption being used. For that you should call the -<cite>ssl_var_lookup</cite> method to get one of the <cite>SSL_CIPHER*</cite> variables.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.log_error"> -<tt class="descclassname">request.</tt><tt class="descname">log_error</tt><big>(</big><em>message</em><span class="optional">[</span>, <em>level</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.log_error" title="Permalink to this definition">¶</a></dt> -<dd><p>An interface to the Apache <cite>ap_log_rerror</cite> function. <em>message</em> is a -string with the error message, <em>level</em> is one of the following -flags constants:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">APLOG_EMERG</span> -<span class="n">APLOG_ALERT</span> -<span class="n">APLOG_CRIT</span> -<span class="n">APLOG_ERR</span> -<span class="n">APLOG_WARNING</span> -<span class="n">APLOG_NOTICE</span> -<span class="n">APLOG_INFO</span> -<span class="n">APLOG_DEBUG</span> -<span class="n">APLOG_NOERRNO</span> -</pre></div> -</div> -<p>If you need to write to log and do not have a reference to a request object, -use the <a class="reference internal" href="#apache.log_error" title="apache.log_error"><tt class="xref py py-func docutils literal"><span class="pre">apache.log_error()</span></tt></a> function.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.meets_conditions"> -<tt class="descclassname">request.</tt><tt class="descname">meets_conditions</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.meets_conditions" title="Permalink to this definition">¶</a></dt> -<dd><p>Calls the Apache <tt class="docutils literal"><span class="pre">ap_meets_conditions()</span></tt> function which returns a -status code. If <em>status</em> is <tt class="xref py py-const docutils literal"><span class="pre">apache.OK</span></tt>, generate the -content of the response normally. If not, simply return <em>status</em>. -Note that <em>mtime</em> (and possibly the ETag header) should be set as -appropriate prior to calling this function. The same goes for -<a class="reference internal" href="#apache.request.status" title="apache.request.status"><tt class="xref py py-meth docutils literal"><span class="pre">request.status()</span></tt></a> if the status differs from <tt class="xref py py-const docutils literal"><span class="pre">apache.OK</span></tt>.</p> -<p>Example:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="c"># ...</span> -<span class="n">r</span><span class="o">.</span><span class="n">headers_out</span><span class="p">[</span><span class="s">'ETag'</span><span class="p">]</span> <span class="o">=</span> <span class="s">'"1130794f-3774-4584-a4ea-0ab19e684268"'</span> -<span class="n">r</span><span class="o">.</span><span class="n">headers_out</span><span class="p">[</span><span class="s">'Expires'</span><span class="p">]</span> <span class="o">=</span> <span class="s">'Mon, 18 Apr 2005 17:30:00 GMT'</span> -<span class="n">r</span><span class="o">.</span><span class="n">update_mtime</span><span class="p">(</span><span class="mi">1000000000</span><span class="p">)</span> -<span class="n">r</span><span class="o">.</span><span class="n">set_last_modified</span><span class="p">()</span> - -<span class="n">status</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">meets_conditions</span><span class="p">()</span> -<span class="k">if</span> <span class="n">status</span> <span class="o">!=</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span><span class="p">:</span> - <span class="k">return</span> <span class="n">status</span> - -<span class="c"># ... do expensive generation of the response content ...</span> -</pre></div> -</div> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.requires"> -<tt class="descclassname">request.</tt><tt class="descname">requires</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.requires" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns a tuple of strings of arguments to <tt class="docutils literal"><span class="pre">require</span></tt> directive.</p> -<p>For example, with the following apache configuration:</p> -<div class="highlight-python"><pre>AuthType Basic -require user joe -require valid-user</pre> -</div> -<p><a class="reference internal" href="#apache.request.requires" title="apache.request.requires"><tt class="xref py py-meth docutils literal"><span class="pre">request.requires()</span></tt></a> would return <tt class="docutils literal"><span class="pre">('user</span> <span class="pre">joe',</span> <span class="pre">'valid-user')</span></tt>.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.read"> -<tt class="descclassname">request.</tt><tt class="descname">read</tt><big>(</big><span class="optional">[</span><em>len</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.read" title="Permalink to this definition">¶</a></dt> -<dd><p>Reads at most <em>len</em> bytes directly from the client, returning a -string with the data read. If the <em>len</em> argument is negative or -omitted, reads all data given by the client.</p> -<p>This function is affected by the <tt class="docutils literal"><span class="pre">Timeout</span></tt> Apache -configuration directive. The read will be aborted and an -<tt class="xref py py-exc docutils literal"><span class="pre">IOError</span></tt> raised if the <tt class="xref py py-exc docutils literal"><span class="pre">Timeout</span></tt> is reached while -reading client data.</p> -<p>This function relies on the client providing the <tt class="docutils literal"><span class="pre">Content-length</span></tt> -header. Absence of the <tt class="docutils literal"><span class="pre">Content-length</span></tt> header will be treated as -if <tt class="docutils literal"><span class="pre">Content-length:</span> <span class="pre">0</span></tt> was supplied.</p> -<p>Incorrect <tt class="docutils literal"><span class="pre">Content-length</span></tt> may cause the function to try to read -more data than available, which will make the function block until -a <tt class="docutils literal"><span class="pre">Timeout</span></tt> is reached.</p> -<p>On Python 3 the output is always bytes.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.readline"> -<tt class="descclassname">request.</tt><tt class="descname">readline</tt><big>(</big><span class="optional">[</span><em>len</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.readline" title="Permalink to this definition">¶</a></dt> -<dd><p>Like <a class="reference internal" href="#apache.request.read" title="apache.request.read"><tt class="xref py py-meth docutils literal"><span class="pre">request.read()</span></tt></a> but reads until end of line.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">In accordance with the HTTP specification, most clients will be -terminating lines with <tt class="docutils literal"><span class="pre">'\r\n'</span></tt> rather than simply -<tt class="docutils literal"><span class="pre">'\n'</span></tt>.</p> -</div> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.readlines"> -<tt class="descclassname">request.</tt><tt class="descname">readlines</tt><big>(</big><span class="optional">[</span><em>sizehint</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.readlines" title="Permalink to this definition">¶</a></dt> -<dd><p>Reads all lines using <a class="reference internal" href="#apache.request.readline" title="apache.request.readline"><tt class="xref py py-meth docutils literal"><span class="pre">request.readline()</span></tt></a> and returns a list of -the lines read. If the optional <em>sizehint</em> parameter is given in, -the method will read at least <em>sizehint</em> bytes of data, up to the -completion of the line in which the <em>sizehint</em> bytes limit is -reached.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.register_cleanup"> -<tt class="descclassname">request.</tt><tt class="descname">register_cleanup</tt><big>(</big><em>callable</em><span class="optional">[</span>, <em>data</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.register_cleanup" title="Permalink to this definition">¶</a></dt> -<dd><p>Registers a cleanup. Argument <em>callable</em> can be any callable -object, the optional argument <em>data</em> can be any object (default is -<tt class="xref docutils literal"><span class="pre">None</span></tt>). At the very end of the request, just before the actual -request record is destroyed by Apache, <em>callable</em> will be -called with one argument, <em>data</em>.</p> -<p>It is OK to pass the request object as data, but keep in mind that -when the cleanup is executed, the request processing is already -complete, so doing things like writing to the client is completely -pointless.</p> -<p>If errors are encountered during cleanup processing, they should be -in error log, but otherwise will not affect request processing in -any way, which makes cleanup bugs sometimes hard to spot.</p> -<p>If the server is shut down before the cleanup had a chance to run, -it’s possible that it will not be executed.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.register_input_filter"> -<tt class="descclassname">request.</tt><tt class="descname">register_input_filter</tt><big>(</big><em>filter_name</em>, <em>filter</em><span class="optional">[</span>, <em>dir</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.register_input_filter" title="Permalink to this definition">¶</a></dt> -<dd><p>Allows dynamic registration of mod_python input -filters. <em>filter_name</em> is a string which would then subsequently be -used to identify the filter. <em>filter</em> is a string containing -the name of the module and the filter function. Optional <em>dir</em> -is a string containing the name of the directory to be added to the -pythonpath. If there is a <tt class="docutils literal"><span class="pre">PythonPath</span></tt> directive in effect, -then <tt class="docutils literal"><span class="pre">sys.path</span></tt> will be set exactly according to it (no -directories added, the <em>dir</em> argument is ignored).</p> -<p>The registration of the filter this way only persists for the life -of the request. To actually add the filter into the chain of input -filters for the current request <tt class="docutils literal"><span class="pre">request.add_input_filter()</span></tt> would be -used.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.register_output_filter"> -<tt class="descclassname">request.</tt><tt class="descname">register_output_filter</tt><big>(</big><em>filter_name</em>, <em>filter</em><span class="optional">[</span>, <em>dir</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.register_output_filter" title="Permalink to this definition">¶</a></dt> -<dd><p>Allows dynamic registration of mod_python output -filters. <em>filter_name</em> is a string which would then subsequently be -used to identify the filter. <em>filter</em> is a string containing the -name of the module and the filter function. Optional <em>dir</em> is a -string containing the name of the directory to be added to the -pythonpath. If there is a <tt class="docutils literal"><span class="pre">PythonPath</span></tt> directive in effect, then -<tt class="docutils literal"><span class="pre">sys.path</span></tt> will be set exactly according to it (no directories -added, the <em>dir</em> argument is ignored).</p> -<p>The registration of the filter this way only persists for the life -of the request. To actually add the filter into the chain of output -filters for the current request <a class="reference internal" href="#apache.request.add_output_filter" title="apache.request.add_output_filter"><tt class="xref py py-meth docutils literal"><span class="pre">request.add_output_filter()</span></tt></a> -would be used.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.sendfile"> -<tt class="descclassname">request.</tt><tt class="descname">sendfile</tt><big>(</big><em>path</em><span class="optional">[</span>, <em>offset</em>, <em>len</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.sendfile" title="Permalink to this definition">¶</a></dt> -<dd><p>Sends <em>len</em> bytes of file <em>path</em> directly to the client, starting -at offset <em>offset</em> using the server’s internal API. <em>offset</em> -defaults to 0, and <em>len</em> defaults to -1 (send the entire file).</p> -<p>Returns the number of bytes sent, or raises an IOError exception on -failure.</p> -<p>This function provides the most efficient way to send a file to the -client.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.set_etag"> -<tt class="descclassname">request.</tt><tt class="descname">set_etag</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.set_etag" title="Permalink to this definition">¶</a></dt> -<dd><p>Sets the outgoing <tt class="docutils literal"><span class="pre">'ETag'</span></tt> header.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.set_last_modified"> -<tt class="descclassname">request.</tt><tt class="descname">set_last_modified</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.set_last_modified" title="Permalink to this definition">¶</a></dt> -<dd><p>Sets the outgoing <tt class="docutils literal"><span class="pre">Last-Modified</span></tt> header based on value of -<tt class="docutils literal"><span class="pre">mtime</span></tt> attribute.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.ssl_var_lookup"> -<tt class="descclassname">request.</tt><tt class="descname">ssl_var_lookup</tt><big>(</big><em>var_name</em><big>)</big><a class="headerlink" href="#apache.request.ssl_var_lookup" title="Permalink to this definition">¶</a></dt> -<dd><p>Looks up the value of the named SSL variable. This method queries -the mod_ssl Apache module directly, and may therefore be used in -early request phases (unlike using the <a class="reference internal" href="#apache.request.subprocess_env" title="apache.request.subprocess_env"><tt class="xref py py-attr docutils literal"><span class="pre">request.subprocess_env</span></tt></a> -member.</p> -<p>If the mod_ssl Apache module is not loaded or the variable is not -found then <tt class="xref docutils literal"><span class="pre">None</span></tt> is returned.</p> -<p>If you just want to know if a SSL or TLS connection is being used, -you may consider calling the <tt class="docutils literal"><span class="pre">is_https</span></tt> method instead.</p> -<p>It is unfortunately not possible to get a list of all available -variables with the current mod_ssl implementation, so you must know -the name of the variable you want. Some of the potentially useful -ssl variables are listed below. For a complete list of variables -and a description of their values see the mod_ssl documentation.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">SSL_CIPHER</span> -<span class="n">SSL_CLIENT_CERT</span> -<span class="n">SSL_CLIENT_VERIFY</span> -<span class="n">SSL_PROTOCOL</span> -<span class="n">SSL_SESSION_ID</span> -</pre></div> -</div> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Not all SSL variables are defined or have useful values in every -request phase. Also use caution when relying on these values -for security purposes, as SSL or TLS protocol parameters can -often be renegotiated at any time during a request.</p> -</div> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.update_mtime"> -<tt class="descclassname">request.</tt><tt class="descname">update_mtime</tt><big>(</big><em>dependency_mtime</em><big>)</big><a class="headerlink" href="#apache.request.update_mtime" title="Permalink to this definition">¶</a></dt> -<dd><p>If <em>ependency_mtime</em> is later than the value in the <tt class="docutils literal"><span class="pre">mtime</span></tt> -attribute, sets the attribute to the new value.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.write"> -<tt class="descclassname">request.</tt><tt class="descname">write</tt><big>(</big><em>string</em><span class="optional">[</span>, <em>flush=1</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.request.write" title="Permalink to this definition">¶</a></dt> -<dd><p>Writes <em>string</em> directly to the client, then flushes the buffer, -unless flush is 0. Unicode strings are encoded using <tt class="docutils literal"><span class="pre">utf-8</span></tt> -encoding.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.flush"> -<tt class="descclassname">request.</tt><tt class="descname">flush</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.request.flush" title="Permalink to this definition">¶</a></dt> -<dd><p>Flushes the output buffer.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.request.set_content_length"> -<tt class="descclassname">request.</tt><tt class="descname">set_content_length</tt><big>(</big><em>len</em><big>)</big><a class="headerlink" href="#apache.request.set_content_length" title="Permalink to this definition">¶</a></dt> -<dd><p>Sets the value of <a class="reference internal" href="#apache.request.clength" title="apache.request.clength"><tt class="xref py py-attr docutils literal"><span class="pre">request.clength</span></tt></a> and the <tt class="docutils literal"><span class="pre">'Content-Length'</span></tt> -header to len. Note that after the headers have been sent out -(which happens just before the first byte of the body is written, -i.e. first call to <a class="reference internal" href="#apache.request.write" title="apache.request.write"><tt class="xref py py-meth docutils literal"><span class="pre">request.write()</span></tt></a>), calling the method is -meaningless.</p> -</dd></dl> - -</div> -<div class="section" id="request-members"> -<span id="pyapi-mprequest-mem"></span><h4>Request Members<a class="headerlink" href="#request-members" title="Permalink to this headline">¶</a></h4> -<dl class="attribute"> -<dt id="apache.request.connection"> -<tt class="descclassname">request.</tt><tt class="descname">connection</tt><a class="headerlink" href="#apache.request.connection" title="Permalink to this definition">¶</a></dt> -<dd><p>A <tt class="docutils literal"><span class="pre">connection</span></tt> object associated with this request. See -<a class="reference internal" href="#pyapi-mpconn"><em>Connection Object (mp_conn)</em></a> Object for more details. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.server"> -<tt class="descclassname">request.</tt><tt class="descname">server</tt><a class="headerlink" href="#apache.request.server" title="Permalink to this definition">¶</a></dt> -<dd><p>A server object associated with this request. See -<a class="reference internal" href="#pyapi-mpserver"><em>Server Object (mp_server)</em></a> for more details. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.next"> -<tt class="descclassname">request.</tt><tt class="descname">next</tt><a class="headerlink" href="#apache.request.next" title="Permalink to this definition">¶</a></dt> -<dd><p>If this is an internal redirect, the request object we redirect to. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.prev"> -<tt class="descclassname">request.</tt><tt class="descname">prev</tt><a class="headerlink" href="#apache.request.prev" title="Permalink to this definition">¶</a></dt> -<dd><p>If this is an internal redirect, the request object we redirect from. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.main"> -<tt class="descclassname">request.</tt><tt class="descname">main</tt><a class="headerlink" href="#apache.request.main" title="Permalink to this definition">¶</a></dt> -<dd><p>If this is a sub-request, pointer to the main request. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.the_request"> -<tt class="descclassname">request.</tt><tt class="descname">the_request</tt><a class="headerlink" href="#apache.request.the_request" title="Permalink to this definition">¶</a></dt> -<dd><p>String containing the first line of the request. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.assbackwards"> -<tt class="descclassname">request.</tt><tt class="descname">assbackwards</tt><a class="headerlink" href="#apache.request.assbackwards" title="Permalink to this definition">¶</a></dt> -<dd><p>Indicates an HTTP/0.9 “simple” request. This means that the -response will contain no headers, only the body. Although this -exists for backwards compatibility with obsolescent browsers, some -people have figured out that setting assbackwards to 1 can be a -useful technique when including part of the response from an -internal redirect to avoid headers being sent.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.proxyreq"> -<tt class="descclassname">request.</tt><tt class="descname">proxyreq</tt><a class="headerlink" href="#apache.request.proxyreq" title="Permalink to this definition">¶</a></dt> -<dd><p>A proxy request: one of <tt class="xref py py-const docutils literal"><span class="pre">apache.PROXYREQ_*</span></tt> values.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.header_only"> -<tt class="descclassname">request.</tt><tt class="descname">header_only</tt><a class="headerlink" href="#apache.request.header_only" title="Permalink to this definition">¶</a></dt> -<dd><p>A boolean value indicating HEAD request, as opposed to GET. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.protocol"> -<tt class="descclassname">request.</tt><tt class="descname">protocol</tt><a class="headerlink" href="#apache.request.protocol" title="Permalink to this definition">¶</a></dt> -<dd><p>Protocol, as given by the client, or <tt class="docutils literal"><span class="pre">'HTTP/0.9'</span></tt>. Same as CGI <span class="target" id="index-8"></span><tt class="xref std std-envvar docutils literal"><span class="pre">SERVER_PROTOCOL</span></tt>. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.proto_num"> -<tt class="descclassname">request.</tt><tt class="descname">proto_num</tt><a class="headerlink" href="#apache.request.proto_num" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Number version of protocol; 1.1 = 1001 <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.hostname"> -<tt class="descclassname">request.</tt><tt class="descname">hostname</tt><a class="headerlink" href="#apache.request.hostname" title="Permalink to this definition">¶</a></dt> -<dd><p>String. Host, as set by full URI or Host: header. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.request_time"> -<tt class="descclassname">request.</tt><tt class="descname">request_time</tt><a class="headerlink" href="#apache.request.request_time" title="Permalink to this definition">¶</a></dt> -<dd><p>A long integer. When request started. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.status_line"> -<tt class="descclassname">request.</tt><tt class="descname">status_line</tt><a class="headerlink" href="#apache.request.status_line" title="Permalink to this definition">¶</a></dt> -<dd><p>Status line. E.g. <tt class="docutils literal"><span class="pre">'200</span> <span class="pre">OK'</span></tt>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.status"> -<tt class="descclassname">request.</tt><tt class="descname">status</tt><a class="headerlink" href="#apache.request.status" title="Permalink to this definition">¶</a></dt> -<dd><p>Status. One of <tt class="xref py py-const docutils literal"><span class="pre">apache.HTTP_*</span></tt> values.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.method"> -<tt class="descclassname">request.</tt><tt class="descname">method</tt><a class="headerlink" href="#apache.request.method" title="Permalink to this definition">¶</a></dt> -<dd><p>A string containing the method - <tt class="docutils literal"><span class="pre">'GET'</span></tt>, <tt class="docutils literal"><span class="pre">'HEAD'</span></tt>, <tt class="docutils literal"><span class="pre">'POST'</span></tt>, etc. Same -as CGI <span class="target" id="index-9"></span><tt class="xref std std-envvar docutils literal"><span class="pre">REQUEST_METHOD</span></tt>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.method_number"> -<tt class="descclassname">request.</tt><tt class="descname">method_number</tt><a class="headerlink" href="#apache.request.method_number" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer containing the method number. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.allowed"> -<tt class="descclassname">request.</tt><tt class="descname">allowed</tt><a class="headerlink" href="#apache.request.allowed" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. A bitvector of the allowed methods. Used to construct the -Allowed: header when responding with -<tt class="xref py py-const docutils literal"><span class="pre">HTTP_METHOD_NOT_ALLOWED</span></tt> or -<tt class="xref py py-const docutils literal"><span class="pre">HTTP_NOT_IMPLEMENTED</span></tt>. This field is for Apache’s -internal use, to set the <tt class="docutils literal"><span class="pre">Allowed:</span></tt> methods use -<a class="reference internal" href="#apache.request.allow_methods" title="apache.request.allow_methods"><tt class="xref py py-meth docutils literal"><span class="pre">request.allow_methods()</span></tt></a> method, described in section -<a class="reference internal" href="#pyapi-mprequest-meth"><em>Request Methods</em></a>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.allowed_xmethods"> -<tt class="descclassname">request.</tt><tt class="descname">allowed_xmethods</tt><a class="headerlink" href="#apache.request.allowed_xmethods" title="Permalink to this definition">¶</a></dt> -<dd><p>Tuple. Allowed extension methods. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.allowed_methods"> -<tt class="descclassname">request.</tt><tt class="descname">allowed_methods</tt><a class="headerlink" href="#apache.request.allowed_methods" title="Permalink to this definition">¶</a></dt> -<dd><p>Tuple. List of allowed methods. Used in relation with -<tt class="xref py py-const docutils literal"><span class="pre">METHOD_NOT_ALLOWED</span></tt>. This member can be modified via -<a class="reference internal" href="#apache.request.allow_methods" title="apache.request.allow_methods"><tt class="xref py py-meth docutils literal"><span class="pre">request.allow_methods()</span></tt></a> described in section -<a class="reference internal" href="#pyapi-mprequest-meth"><em>Request Methods</em></a>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.sent_bodyct"> -<tt class="descclassname">request.</tt><tt class="descname">sent_bodyct</tt><a class="headerlink" href="#apache.request.sent_bodyct" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Byte count in stream is for body. (?) <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.bytes_sent"> -<tt class="descclassname">request.</tt><tt class="descname">bytes_sent</tt><a class="headerlink" href="#apache.request.bytes_sent" title="Permalink to this definition">¶</a></dt> -<dd><p>Long integer. Number of bytes sent. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.mtime"> -<tt class="descclassname">request.</tt><tt class="descname">mtime</tt><a class="headerlink" href="#apache.request.mtime" title="Permalink to this definition">¶</a></dt> -<dd><p>Long integer. Time the resource was last modified. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.chunked"> -<tt class="descclassname">request.</tt><tt class="descname">chunked</tt><a class="headerlink" href="#apache.request.chunked" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean value indicating when sending chunked transfer-coding. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.range"> -<tt class="descclassname">request.</tt><tt class="descname">range</tt><a class="headerlink" href="#apache.request.range" title="Permalink to this definition">¶</a></dt> -<dd><p>String. The <tt class="docutils literal"><span class="pre">Range:</span></tt> header. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.clength"> -<tt class="descclassname">request.</tt><tt class="descname">clength</tt><a class="headerlink" href="#apache.request.clength" title="Permalink to this definition">¶</a></dt> -<dd><p>Long integer. The “real” content length. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.remaining"> -<tt class="descclassname">request.</tt><tt class="descname">remaining</tt><a class="headerlink" href="#apache.request.remaining" title="Permalink to this definition">¶</a></dt> -<dd><p>Long integer. Bytes left to read. (Only makes sense inside a read -operation.) <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.read_length"> -<tt class="descclassname">request.</tt><tt class="descname">read_length</tt><a class="headerlink" href="#apache.request.read_length" title="Permalink to this definition">¶</a></dt> -<dd><p>Long integer. Number of bytes read. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.read_body"> -<tt class="descclassname">request.</tt><tt class="descname">read_body</tt><a class="headerlink" href="#apache.request.read_body" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. How the request body should be read. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.read_chunked"> -<tt class="descclassname">request.</tt><tt class="descname">read_chunked</tt><a class="headerlink" href="#apache.request.read_chunked" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean. Read chunked transfer coding. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.expecting_100"> -<tt class="descclassname">request.</tt><tt class="descname">expecting_100</tt><a class="headerlink" href="#apache.request.expecting_100" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean. Is client waiting for a 100 (<tt class="xref py py-const docutils literal"><span class="pre">HTTP_CONTINUE</span></tt>) -response. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.headers_in"> -<tt class="descclassname">request.</tt><tt class="descname">headers_in</tt><a class="headerlink" href="#apache.request.headers_in" title="Permalink to this definition">¶</a></dt> -<dd><p>A <a class="reference internal" href="#apache.table" title="apache.table"><tt class="xref py py-class docutils literal"><span class="pre">table</span></tt></a> object containing headers sent by the client.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.headers_out"> -<tt class="descclassname">request.</tt><tt class="descname">headers_out</tt><a class="headerlink" href="#apache.request.headers_out" title="Permalink to this definition">¶</a></dt> -<dd><p>A <a class="reference internal" href="#apache.table" title="apache.table"><tt class="xref py py-class docutils literal"><span class="pre">table</span></tt></a> object representing the headers to be sent to the -client.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.err_headers_out"> -<tt class="descclassname">request.</tt><tt class="descname">err_headers_out</tt><a class="headerlink" href="#apache.request.err_headers_out" title="Permalink to this definition">¶</a></dt> -<dd><p>These headers get send with the error response, instead of -headers_out.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.subprocess_env"> -<tt class="descclassname">request.</tt><tt class="descname">subprocess_env</tt><a class="headerlink" href="#apache.request.subprocess_env" title="Permalink to this definition">¶</a></dt> -<dd><p>A <a class="reference internal" href="#apache.table" title="apache.table"><tt class="xref py py-class docutils literal"><span class="pre">table</span></tt></a> object containing environment information -typically usable for CGI. You may have to call -<a class="reference internal" href="#apache.request.add_common_vars" title="apache.request.add_common_vars"><tt class="xref py py-meth docutils literal"><span class="pre">request.add_common_vars()</span></tt></a> and <a class="reference internal" href="#apache.request.add_cgi_vars" title="apache.request.add_cgi_vars"><tt class="xref py py-meth docutils literal"><span class="pre">request.add_cgi_vars()</span></tt></a> -first to fill in the information you need.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.notes"> -<tt class="descclassname">request.</tt><tt class="descname">notes</tt><a class="headerlink" href="#apache.request.notes" title="Permalink to this definition">¶</a></dt> -<dd><p>A <a class="reference internal" href="#apache.table" title="apache.table"><tt class="xref py py-class docutils literal"><span class="pre">table</span></tt></a> object that could be used to store miscellaneous -general purpose info that lives for as long as the request -lives. If you need to pass data between handlers, it’s better to -simply add members to the request object than to use -<a class="reference internal" href="#apache.request.notes" title="apache.request.notes"><tt class="xref py py-attr docutils literal"><span class="pre">request.notes</span></tt></a>.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.phase"> -<tt class="descclassname">request.</tt><tt class="descname">phase</tt><a class="headerlink" href="#apache.request.phase" title="Permalink to this definition">¶</a></dt> -<dd><p>The phase currently being being processed, -e.g. <tt class="docutils literal"><span class="pre">'PythonHandler'</span></tt>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.interpreter"> -<tt class="descclassname">request.</tt><tt class="descname">interpreter</tt><a class="headerlink" href="#apache.request.interpreter" title="Permalink to this definition">¶</a></dt> -<dd><p>The name of the subinterpreter under which we’re running. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.content_type"> -<tt class="descclassname">request.</tt><tt class="descname">content_type</tt><a class="headerlink" href="#apache.request.content_type" title="Permalink to this definition">¶</a></dt> -<dd><p>String. The content type. Mod_python maintains an internal flag -(<tt class="xref py py-attr docutils literal"><span class="pre">request._content_type_set</span></tt>) to keep track of whether -<a class="reference internal" href="#apache.request.content_type" title="apache.request.content_type"><tt class="xref py py-attr docutils literal"><span class="pre">request.content_type</span></tt></a> was set manually from within -Python. The publisher handler uses this flag in the following way: -when <a class="reference internal" href="#apache.request.content_type" title="apache.request.content_type"><tt class="xref py py-attr docutils literal"><span class="pre">request.content_type</span></tt></a> isn’t explicitly set, it attempts -to guess the content type by examining the first few bytes of the -output.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.content_languages"> -<tt class="descclassname">request.</tt><tt class="descname">content_languages</tt><a class="headerlink" href="#apache.request.content_languages" title="Permalink to this definition">¶</a></dt> -<dd><p>Tuple. List of strings representing the content languages.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.handler"> -<tt class="descclassname">request.</tt><tt class="descname">handler</tt><a class="headerlink" href="#apache.request.handler" title="Permalink to this definition">¶</a></dt> -<dd><p>The symbolic name of the content handler (as in module, not -mod_python handler) that will service the request during the -response phase. When the SetHandler/AddHandler directives are used -to trigger mod_python, this will be set to <tt class="docutils literal"><span class="pre">'mod_python'</span></tt> by -mod_mime. A mod_python handler executing prior to the response -phase may also set this to <tt class="docutils literal"><span class="pre">'mod_python'</span></tt> along with calling -<a class="reference internal" href="#apache.request.add_handler" title="apache.request.add_handler"><tt class="xref py py-meth docutils literal"><span class="pre">request.add_handler()</span></tt></a> to register a mod_python handler for -the response phase:</p> -<div class="highlight-python"><pre>def typehandler(req): - if os.path.splitext(req.filename)[1] == ".py": - req.handler = "mod_python" - req.add_handler("PythonHandler", "mod_python.publisher") - return apache.OK - return apache.DECLINED</pre> -</div> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.content_encoding"> -<tt class="descclassname">request.</tt><tt class="descname">content_encoding</tt><a class="headerlink" href="#apache.request.content_encoding" title="Permalink to this definition">¶</a></dt> -<dd><p>String. Content encoding. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.vlist_validator"> -<tt class="descclassname">request.</tt><tt class="descname">vlist_validator</tt><a class="headerlink" href="#apache.request.vlist_validator" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Variant list validator (if negotiated). <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.user"> -<tt class="descclassname">request.</tt><tt class="descname">user</tt><a class="headerlink" href="#apache.request.user" title="Permalink to this definition">¶</a></dt> -<dd><p>If an authentication check is made, this will hold the user -name. Same as CGI <span class="target" id="index-10"></span><tt class="xref std std-envvar docutils literal"><span class="pre">REMOTE_USER</span></tt>.</p> -<p>On Python 3 the string is decoded using Latin1. (Different browsers -use different encodings for non-Latin1 characters for the basic -authentication string making a solution that fits all impossible, -you can always decode the header manually.)</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last"><a class="reference internal" href="#apache.request.get_basic_auth_pw" title="apache.request.get_basic_auth_pw"><tt class="xref py py-meth docutils literal"><span class="pre">request.get_basic_auth_pw()</span></tt></a> must be called prior to using this value.</p> -</div> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.ap_auth_type"> -<tt class="descclassname">request.</tt><tt class="descname">ap_auth_type</tt><a class="headerlink" href="#apache.request.ap_auth_type" title="Permalink to this definition">¶</a></dt> -<dd><p>Authentication type. Same as CGI <span class="target" id="index-11"></span><tt class="xref std std-envvar docutils literal"><span class="pre">AUTH_TYPE</span></tt>.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.no_cache"> -<tt class="descclassname">request.</tt><tt class="descname">no_cache</tt><a class="headerlink" href="#apache.request.no_cache" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean. This response cannot be cached.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.no_local_copy"> -<tt class="descclassname">request.</tt><tt class="descname">no_local_copy</tt><a class="headerlink" href="#apache.request.no_local_copy" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean. No local copy exists.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.unparsed_uri"> -<tt class="descclassname">request.</tt><tt class="descname">unparsed_uri</tt><a class="headerlink" href="#apache.request.unparsed_uri" title="Permalink to this definition">¶</a></dt> -<dd><p>The URI without any parsing performed. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.uri"> -<tt class="descclassname">request.</tt><tt class="descname">uri</tt><a class="headerlink" href="#apache.request.uri" title="Permalink to this definition">¶</a></dt> -<dd><p>The path portion of the URI.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.filename"> -<tt class="descclassname">request.</tt><tt class="descname">filename</tt><a class="headerlink" href="#apache.request.filename" title="Permalink to this definition">¶</a></dt> -<dd><p>String. File name being requested.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.canonical_filename"> -<tt class="descclassname">request.</tt><tt class="descname">canonical_filename</tt><a class="headerlink" href="#apache.request.canonical_filename" title="Permalink to this definition">¶</a></dt> -<dd><p>String. The true filename (<a class="reference internal" href="#apache.request.filename" title="apache.request.filename"><tt class="xref py py-attr docutils literal"><span class="pre">request.filename</span></tt></a> is -canonicalized if they don’t match).</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.path_info"> -<tt class="descclassname">request.</tt><tt class="descname">path_info</tt><a class="headerlink" href="#apache.request.path_info" title="Permalink to this definition">¶</a></dt> -<dd><p>String. What follows after the file name, but is before query args, -if anything. Same as CGI <span class="target" id="index-12"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH_INFO</span></tt>.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.args"> -<tt class="descclassname">request.</tt><tt class="descname">args</tt><a class="headerlink" href="#apache.request.args" title="Permalink to this definition">¶</a></dt> -<dd><p>String. Same as CGI <span class="target" id="index-13"></span><tt class="xref std std-envvar docutils literal"><span class="pre">QUERY_ARGS</span></tt>.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.finfo"> -<tt class="descclassname">request.</tt><tt class="descname">finfo</tt><a class="headerlink" href="#apache.request.finfo" title="Permalink to this definition">¶</a></dt> -<dd><p>A file information object with type <tt class="docutils literal"><span class="pre">mp_finfo</span></tt>, analogous to the -result of the POSIX stat function, describing the file pointed to -by the URI. The object provides the attributes <tt class="docutils literal"><span class="pre">fname</span></tt>, -<tt class="docutils literal"><span class="pre">filetype</span></tt>, <tt class="docutils literal"><span class="pre">valid</span></tt>, <tt class="docutils literal"><span class="pre">protection</span></tt>, <tt class="docutils literal"><span class="pre">user</span></tt>, <tt class="docutils literal"><span class="pre">group</span></tt>, <tt class="docutils literal"><span class="pre">size</span></tt>, -<tt class="docutils literal"><span class="pre">inode</span></tt>, <tt class="docutils literal"><span class="pre">device</span></tt>, <tt class="docutils literal"><span class="pre">nlink</span></tt>, <tt class="docutils literal"><span class="pre">atime</span></tt>, <tt class="docutils literal"><span class="pre">mtime</span></tt>, <tt class="docutils literal"><span class="pre">ctime</span></tt> and -<tt class="docutils literal"><span class="pre">name</span></tt>.</p> -<p>The attribute may be assigned to using the result of -<a class="reference internal" href="#apache.stat" title="apache.stat"><tt class="xref py py-func docutils literal"><span class="pre">apache.stat()</span></tt></a>. For example:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">if</span> <span class="n">req</span><span class="o">.</span><span class="n">finfo</span><span class="o">.</span><span class="n">filetype</span> <span class="o">==</span> <span class="n">apache</span><span class="o">.</span><span class="n">APR_DIR</span><span class="p">:</span> - <span class="n">req</span><span class="o">.</span><span class="n">filename</span> <span class="o">=</span> <span class="n">posixpath</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">filename</span><span class="p">,</span> <span class="s">'index.html'</span><span class="p">)</span> - <span class="n">req</span><span class="o">.</span><span class="n">finfo</span> <span class="o">=</span> <span class="n">apache</span><span class="o">.</span><span class="n">stat</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">filename</span><span class="p">,</span> <span class="n">apache</span><span class="o">.</span><span class="n">APR_FINFO_MIN</span><span class="p">)</span> -</pre></div> -</div> -<p>For backward compatibility, the object can also be accessed as if -it were a tuple. The <tt class="docutils literal"><span class="pre">apache</span></tt> module defines a set of -<tt class="xref py py-const docutils literal"><span class="pre">FINFO_*</span></tt> constants that should be used to access elements -of this tuple.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">user</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">finfo</span><span class="p">[</span><span class="n">apache</span><span class="o">.</span><span class="n">FINFO_USER</span><span class="p">]</span> -</pre></div> -</div> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.parsed_uri"> -<tt class="descclassname">request.</tt><tt class="descname">parsed_uri</tt><a class="headerlink" href="#apache.request.parsed_uri" title="Permalink to this definition">¶</a></dt> -<dd><p>Tuple. The URI broken down into pieces. <tt class="docutils literal"><span class="pre">(scheme,</span> <span class="pre">hostinfo,</span> <span class="pre">user,</span> <span class="pre">password,</span> <span class="pre">hostname,</span> <span class="pre">port,</span> <span class="pre">path,</span> <span class="pre">query,</span> <span class="pre">fragment)</span></tt>. -The <a class="reference internal" href="#module-apache" title="apache: Access to Apache Internals."><tt class="xref py py-mod docutils literal"><span class="pre">apache</span></tt></a> module defines a set of <tt class="xref py py-const docutils literal"><span class="pre">URI_*</span></tt> constants that -should be used to access elements of this tuple. Example:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">fname</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">parsed_uri</span><span class="p">[</span><span class="n">apache</span><span class="o">.</span><span class="n">URI_PATH</span><span class="p">]</span> -</pre></div> -</div> -<p><em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.used_path_info"> -<tt class="descclassname">request.</tt><tt class="descname">used_path_info</tt><a class="headerlink" href="#apache.request.used_path_info" title="Permalink to this definition">¶</a></dt> -<dd><p>Flag to accept or reject path_info on current request.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.eos_sent"> -<tt class="descclassname">request.</tt><tt class="descname">eos_sent</tt><a class="headerlink" href="#apache.request.eos_sent" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean. EOS bucket sent. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.useragent_addr"> -<tt class="descclassname">request.</tt><tt class="descname">useragent_addr</tt><a class="headerlink" href="#apache.request.useragent_addr" title="Permalink to this definition">¶</a></dt> -<dd><p><em>Apache 2.4 only</em></p> -<p>The (address, port) tuple for the user agent.</p> -<p>This attribute should reflect the address of the user agent and -not necessarily the other end of the TCP connection, for which -there is <a class="reference internal" href="#apache.connection.client_addr" title="apache.connection.client_addr"><tt class="xref py py-attr docutils literal"><span class="pre">connection.client_addr</span></tt></a>. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.request.useragent_ip"> -<tt class="descclassname">request.</tt><tt class="descname">useragent_ip</tt><a class="headerlink" href="#apache.request.useragent_ip" title="Permalink to this definition">¶</a></dt> -<dd><p><em>Apache 2.4 only</em></p> -<p>String with the IP of the user agent. Same as CGI <span class="target" id="index-14"></span><tt class="xref std std-envvar docutils literal"><span class="pre">REMOTE_ADDR</span></tt>.</p> -<p>This attribute should reflect the address of the user agent and -not necessarily the other end of the TCP connection, for which -there is <a class="reference internal" href="#apache.connection.client_ip" title="apache.connection.client_ip"><tt class="xref py py-attr docutils literal"><span class="pre">connection.client_ip</span></tt></a>. -<em>(Read-Only)</em></p> -</dd></dl> - -</div> -</div> -<div class="section" id="connection-object-mp-conn"> -<span id="pyapi-mpconn"></span><h3>Connection Object (mp_conn)<a class="headerlink" href="#connection-object-mp-conn" title="Permalink to this headline">¶</a></h3> -<p id="index-15">The connection object is a Python mapping to the Apache -<tt class="xref c c-type docutils literal"><span class="pre">conn_rec</span></tt> structure.</p> -<div class="section" id="connection-methods"> -<span id="pyapi-mpconn-meth"></span><h4>Connection Methods<a class="headerlink" href="#connection-methods" title="Permalink to this headline">¶</a></h4> -<dl class="method"> -<dt id="apache.connection.log_error"> -<tt class="descclassname">connection.</tt><tt class="descname">log_error</tt><big>(</big><em>message</em><span class="optional">[</span>, <em>level</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.connection.log_error" title="Permalink to this definition">¶</a></dt> -<dd><p>An interface to the Apache <tt class="docutils literal"><span class="pre">ap_log_cerror</span></tt> function. <em>message</em> is -a string with the error message, <em>level</em> is one of the following -flags constants:</p> -<div class="highlight-python"><pre> APLOG_EMERG - APLOG_ALERT - APLOG_CRIT - APLOG_ERR - APLOG_WARNING - APLOG_NOTICE - APLOG_INFO - APLOG_DEBUG - APLOG_NOERRNO - -If you need to write to log and do not have a reference to a connection or -request object, use the :func:`apache.log_error` function.</pre> -</div> -</dd></dl> - -<dl class="method"> -<dt id="apache.connection.read"> -<tt class="descclassname">connection.</tt><tt class="descname">read</tt><big>(</big><span class="optional">[</span><em>length</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.connection.read" title="Permalink to this definition">¶</a></dt> -<dd><p>Reads at most <em>length</em> bytes from the client. The read blocks -indefinitely until there is at least one byte to read. If length is --1, keep reading until the socket is closed from the other end -(This is known as <tt class="docutils literal"><span class="pre">EXHAUSTIVE</span></tt> mode in the http server code).</p> -<p>This method should only be used inside <em>Connection Handlers</em>.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">The behavior of this method has changed since version 3.0.3. In -3.0.3 and prior, this method would block until <em>length</em> bytes -was read.</p> -</div> -</dd></dl> - -<dl class="method"> -<dt id="apache.connection.readline"> -<tt class="descclassname">connection.</tt><tt class="descname">readline</tt><big>(</big><span class="optional">[</span><em>length</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.connection.readline" title="Permalink to this definition">¶</a></dt> -<dd><p>Reads a line from the connection or up to <em>length</em> bytes.</p> -<p>This method should only be used inside <em>Connection Handlers</em>.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.connection.write"> -<tt class="descclassname">connection.</tt><tt class="descname">write</tt><big>(</big><em>string</em><big>)</big><a class="headerlink" href="#apache.connection.write" title="Permalink to this definition">¶</a></dt> -<dd><p>Writes <em>string</em> to the client.</p> -<p>This method should only be used inside <em>Connection Handlers</em>.</p> -</dd></dl> - -</div> -<div class="section" id="connection-members"> -<span id="pyapi-mpconn-mem"></span><h4>Connection Members<a class="headerlink" href="#connection-members" title="Permalink to this headline">¶</a></h4> -<dl class="attribute"> -<dt id="apache.connection.base_server"> -<tt class="descclassname">connection.</tt><tt class="descname">base_server</tt><a class="headerlink" href="#apache.connection.base_server" title="Permalink to this definition">¶</a></dt> -<dd><p>A <tt class="docutils literal"><span class="pre">server</span></tt> object for the physical vhost that this connection came -in through. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.local_addr"> -<tt class="descclassname">connection.</tt><tt class="descname">local_addr</tt><a class="headerlink" href="#apache.connection.local_addr" title="Permalink to this definition">¶</a></dt> -<dd><p>The (address, port) tuple for the server. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.remote_addr"> -<tt class="descclassname">connection.</tt><tt class="descname">remote_addr</tt><a class="headerlink" href="#apache.connection.remote_addr" title="Permalink to this definition">¶</a></dt> -<dd><p><em>Deprecated in Apache 2.4, use client_addr. (Aliased to client_addr for backward compatibility)</em></p> -<p>The (address, port) tuple for the client. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.client_addr"> -<tt class="descclassname">connection.</tt><tt class="descname">client_addr</tt><a class="headerlink" href="#apache.connection.client_addr" title="Permalink to this definition">¶</a></dt> -<dd><p><em>Apache 2.4 only</em></p> -<p>The (address, port) tuple for the client.</p> -<p>This attribute reflects the other end of the TCP connection, which -may not always be the address of the user agent. A more accurate -source of the user agent address is <a class="reference internal" href="#apache.request.useragent_addr" title="apache.request.useragent_addr"><tt class="xref py py-attr docutils literal"><span class="pre">request.useragent_addr</span></tt></a>. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.remote_ip"> -<tt class="descclassname">connection.</tt><tt class="descname">remote_ip</tt><a class="headerlink" href="#apache.connection.remote_ip" title="Permalink to this definition">¶</a></dt> -<dd><p><em>Deprecated in Apache 2.4, use client_ip. (Aliased to client_ip for backward compatibility)</em></p> -<p>String with the IP of the client. In Apache 2.2 same as CGI <span class="target" id="index-16"></span><tt class="xref std std-envvar docutils literal"><span class="pre">REMOTE_ADDR</span></tt>. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.client_ip"> -<tt class="descclassname">connection.</tt><tt class="descname">client_ip</tt><a class="headerlink" href="#apache.connection.client_ip" title="Permalink to this definition">¶</a></dt> -<dd><p><em>Apache 2.4 only</em></p> -<p>String with the IP of the client.</p> -<p>This attribute reflects the other end of the TCP connection, which -may not always be the address of the user agent. A more accurate -source of the user agent address is <a class="reference internal" href="#apache.request.useragent_ip" title="apache.request.useragent_ip"><tt class="xref py py-attr docutils literal"><span class="pre">request.useragent_ip</span></tt></a>.</p> -<p><em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.remote_host"> -<tt class="descclassname">connection.</tt><tt class="descname">remote_host</tt><a class="headerlink" href="#apache.connection.remote_host" title="Permalink to this definition">¶</a></dt> -<dd><p>String. The DNS name of the remote client. None if DNS has not been -checked, <tt class="docutils literal"><span class="pre">''</span></tt> (empty string) if no name found. Same as CGI -<span class="target" id="index-17"></span><tt class="xref std std-envvar docutils literal"><span class="pre">REMOTE_HOST</span></tt>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.remote_logname"> -<tt class="descclassname">connection.</tt><tt class="descname">remote_logname</tt><a class="headerlink" href="#apache.connection.remote_logname" title="Permalink to this definition">¶</a></dt> -<dd><p>Remote name if using <span class="target" id="index-18"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc1413.html"><strong>RFC 1413</strong></a> (ident). Same as CGI -<span class="target" id="index-19"></span><tt class="xref std std-envvar docutils literal"><span class="pre">REMOTE_IDENT</span></tt>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.aborted"> -<tt class="descclassname">connection.</tt><tt class="descname">aborted</tt><a class="headerlink" href="#apache.connection.aborted" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean. True is the connection is aborted. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.keepalive"> -<tt class="descclassname">connection.</tt><tt class="descname">keepalive</tt><a class="headerlink" href="#apache.connection.keepalive" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. 1 means the connection will be kept for the next request, -0 means “undecided”, -1 means “fatal error”. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.double_reverse"> -<tt class="descclassname">connection.</tt><tt class="descname">double_reverse</tt><a class="headerlink" href="#apache.connection.double_reverse" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. 1 means double reverse DNS lookup has been performed, 0 -means not yet, -1 means yes and it failed. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.keepalives"> -<tt class="descclassname">connection.</tt><tt class="descname">keepalives</tt><a class="headerlink" href="#apache.connection.keepalives" title="Permalink to this definition">¶</a></dt> -<dd><p>The number of times this connection has been used. (?) -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.local_ip"> -<tt class="descclassname">connection.</tt><tt class="descname">local_ip</tt><a class="headerlink" href="#apache.connection.local_ip" title="Permalink to this definition">¶</a></dt> -<dd><p>String with the IP of the server. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.local_host"> -<tt class="descclassname">connection.</tt><tt class="descname">local_host</tt><a class="headerlink" href="#apache.connection.local_host" title="Permalink to this definition">¶</a></dt> -<dd><p>DNS name of the server. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.id"> -<tt class="descclassname">connection.</tt><tt class="descname">id</tt><a class="headerlink" href="#apache.connection.id" title="Permalink to this definition">¶</a></dt> -<dd><p>Long. A unique connection id. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.connection.notes"> -<tt class="descclassname">connection.</tt><tt class="descname">notes</tt><a class="headerlink" href="#apache.connection.notes" title="Permalink to this definition">¶</a></dt> -<dd><p>A <a class="reference internal" href="#apache.table" title="apache.table"><tt class="xref py py-class docutils literal"><span class="pre">table</span></tt></a> object containing miscellaneous general purpose -info that lives for as long as the connection lives.</p> -</dd></dl> - -</div> -</div> -<div class="section" id="filter-object-mp-filter"> -<span id="pyapi-mpfilt"></span><h3>Filter Object (mp_filter)<a class="headerlink" href="#filter-object-mp-filter" title="Permalink to this headline">¶</a></h3> -<p id="index-20">A filter object is passed to mod_python input and output filters. It -is used to obtain filter information, as well as get and pass -information to adjacent filters in the filter stack.</p> -<div class="section" id="filter-methods"> -<span id="pyapi-mpfilt-meth"></span><h4>Filter Methods<a class="headerlink" href="#filter-methods" title="Permalink to this headline">¶</a></h4> -<dl class="method"> -<dt id="apache.filter.pass_on"> -<tt class="descclassname">filter.</tt><tt class="descname">pass_on</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.filter.pass_on" title="Permalink to this definition">¶</a></dt> -<dd><p>Passes all data through the filter without any processing.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.filter.read"> -<tt class="descclassname">filter.</tt><tt class="descname">read</tt><big>(</big><span class="optional">[</span><em>length</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.filter.read" title="Permalink to this definition">¶</a></dt> -<dd><p>Reads at most <em>len</em> bytes from the next filter, returning a -string with the data read or None if End Of Stream (EOS) has been -reached. A filter <em>must</em> be closed once the EOS has been -encountered.</p> -<p>If the <em>length</em> argument is negative or omitted, reads all data -currently available.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.filter.readline"> -<tt class="descclassname">filter.</tt><tt class="descname">readline</tt><big>(</big><span class="optional">[</span><em>length</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.filter.readline" title="Permalink to this definition">¶</a></dt> -<dd><p>Reads a line from the next filter or up to <em>length</em> bytes.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.filter.write"> -<tt class="descclassname">filter.</tt><tt class="descname">write</tt><big>(</big><em>string</em><big>)</big><a class="headerlink" href="#apache.filter.write" title="Permalink to this definition">¶</a></dt> -<dd><p>Writes <em>string</em> to the next filter.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.filte.flush"> -<tt class="descclassname">filte.</tt><tt class="descname">flush</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.filte.flush" title="Permalink to this definition">¶</a></dt> -<dd><p>Flushes the output by sending a FLUSH bucket.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.filter.close"> -<tt class="descclassname">filter.</tt><tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.filter.close" title="Permalink to this definition">¶</a></dt> -<dd><p>Closes the filter and sends an EOS bucket. Any further IO -operations on this filter will throw an exception.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.filter.disable"> -<tt class="descclassname">filter.</tt><tt class="descname">disable</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.filter.disable" title="Permalink to this definition">¶</a></dt> -<dd><p>Tells mod_python to ignore the provided handler and just pass the -data on. Used internally by mod_python to print traceback from -exceptions encountered in filter handlers to avoid an infinite -loop.</p> -</dd></dl> - -</div> -<div class="section" id="filter-members"> -<span id="pyapi-mpfilt-mem"></span><h4>Filter Members<a class="headerlink" href="#filter-members" title="Permalink to this headline">¶</a></h4> -<dl class="attribute"> -<dt id="apache.filter.closed"> -<tt class="descclassname">filter.</tt><tt class="descname">closed</tt><a class="headerlink" href="#apache.filter.closed" title="Permalink to this definition">¶</a></dt> -<dd><p>A boolean value indicating whether a filter is closed. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.filter.name"> -<tt class="descclassname">filter.</tt><tt class="descname">name</tt><a class="headerlink" href="#apache.filter.name" title="Permalink to this definition">¶</a></dt> -<dd><p>String. The name under which this filter is registered. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.filter.req"> -<tt class="descclassname">filter.</tt><tt class="descname">req</tt><a class="headerlink" href="#apache.filter.req" title="Permalink to this definition">¶</a></dt> -<dd><p>A reference to the request object. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.filter.is_input"> -<tt class="descclassname">filter.</tt><tt class="descname">is_input</tt><a class="headerlink" href="#apache.filter.is_input" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean. True if this is an input filter. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.filter.handler"> -<tt class="descclassname">filter.</tt><tt class="descname">handler</tt><a class="headerlink" href="#apache.filter.handler" title="Permalink to this definition">¶</a></dt> -<dd><p>String. The name of the Python handler for this filter as specified -in the configuration. <em>(Read-Only)</em></p> -</dd></dl> - -</div> -<div class="section" id="server-object-mp-server"> -<span id="pyapi-mpserver"></span><h4>Server Object (mp_server)<a class="headerlink" href="#server-object-mp-server" title="Permalink to this headline">¶</a></h4> -<p id="index-21">The request object is a Python mapping to the Apache -<tt class="docutils literal"><span class="pre">request_rec</span></tt> structure. The server structure describes the -server (possibly virtual server) serving the request.</p> -</div> -<div class="section" id="server-methods"> -<span id="pyapi-mpsrv-meth"></span><h4>Server Methods<a class="headerlink" href="#server-methods" title="Permalink to this headline">¶</a></h4> -<dl class="method"> -<dt id="apache.server.get_config"> -<tt class="descclassname">server.</tt><tt class="descname">get_config</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.server.get_config" title="Permalink to this definition">¶</a></dt> -<dd><p>Similar to <a class="reference internal" href="#apache.request.get_config" title="apache.request.get_config"><tt class="xref py py-meth docutils literal"><span class="pre">request.get_config()</span></tt></a>, but returns a table object -holding only the mod_python configuration defined at global scope -within the Apache configuration. That is, outside of the context of -any VirtualHost, Location, Directory or Files directives.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.server.get_options"> -<tt class="descclassname">server.</tt><tt class="descname">get_options</tt><big>(</big><big>)</big><a class="headerlink" href="#apache.server.get_options" title="Permalink to this definition">¶</a></dt> -<dd><p>Similar to <a class="reference internal" href="#apache.request.get_options" title="apache.request.get_options"><tt class="xref py py-meth docutils literal"><span class="pre">request.get_options()</span></tt></a>, but returns a table -object holding only the mod_python options defined at global scope -within the Apache configuration. That is, outside of the context of -any VirtualHost, Location, Directory or Files directives.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.server.log_error"> -<tt class="descclassname">server.</tt><tt class="descname">log_error</tt><big>(</big><em>message[level]</em><big>)</big><a class="headerlink" href="#apache.server.log_error" title="Permalink to this definition">¶</a></dt> -<dd><p>An interface to the Apache <tt class="docutils literal"><span class="pre">ap_log_error</span></tt> function. <em>message</em> is -a string with the error message, <em>level</em> is one of the following -flags constants:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">APLOG_EMERG</span> -<span class="n">APLOG_ALERT</span> -<span class="n">APLOG_CRIT</span> -<span class="n">APLOG_ERR</span> -<span class="n">APLOG_WARNING</span> -<span class="n">APLOG_NOTICE</span> -<span class="n">APLOG_INFO</span> -<span class="n">APLOG_DEBUG</span> -<span class="n">APLOG_NOERRNO</span> -</pre></div> -</div> -<p>If you need to write to log and do not have a reference to a server or -request object, use the <a class="reference internal" href="#apache.log_error" title="apache.log_error"><tt class="xref py py-func docutils literal"><span class="pre">apache.log_error()</span></tt></a> function.</p> -</dd></dl> - -<dl class="method"> -<dt id="apache.server.register_cleanup"> -<tt class="descclassname">server.</tt><tt class="descname">register_cleanup</tt><big>(</big><em>request</em>, <em>callable</em><span class="optional">[</span>, <em>data</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#apache.server.register_cleanup" title="Permalink to this definition">¶</a></dt> -<dd><p>Registers a cleanup. Very similar to <tt class="xref py py-meth docutils literal"><span class="pre">req.register_cleanup()</span></tt>, -except this cleanup will be executed at child termination -time. This function requires the request object be supplied to -infer the interpreter name. If you don’t have any request object -at hand, then you must use the <a class="reference internal" href="#apache.register_cleanup" title="apache.register_cleanup"><tt class="xref py py-func docutils literal"><span class="pre">apache.register_cleanup()</span></tt></a> -variant.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last"><em>Warning:</em> do not pass directly or indirectly a request object in -the data parameter. Since the callable will be called at server -shutdown time, the request object won’t exist anymore and any -manipulation of it in the callable will give undefined behaviour.</p> -</div> -</dd></dl> - -</div> -<div class="section" id="server-members"> -<span id="pyapi-mpsrv-mem"></span><h4>Server Members<a class="headerlink" href="#server-members" title="Permalink to this headline">¶</a></h4> -<dl class="attribute"> -<dt id="apache.server.defn_name"> -<tt class="descclassname">server.</tt><tt class="descname">defn_name</tt><a class="headerlink" href="#apache.server.defn_name" title="Permalink to this definition">¶</a></dt> -<dd><p>String. The name of the configuration file where the server -definition was found. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.defn_line_number"> -<tt class="descclassname">server.</tt><tt class="descname">defn_line_number</tt><a class="headerlink" href="#apache.server.defn_line_number" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Line number in the config file where the server definition -is found. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.server_admin"> -<tt class="descclassname">server.</tt><tt class="descname">server_admin</tt><a class="headerlink" href="#apache.server.server_admin" title="Permalink to this definition">¶</a></dt> -<dd><p>Value of the <tt class="docutils literal"><span class="pre">ServerAdmin</span></tt> directive. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.server_hostname"> -<tt class="descclassname">server.</tt><tt class="descname">server_hostname</tt><a class="headerlink" href="#apache.server.server_hostname" title="Permalink to this definition">¶</a></dt> -<dd><p>Value of the <tt class="docutils literal"><span class="pre">ServerName</span></tt> directive. Same as CGI -<span class="target" id="index-22"></span><tt class="xref std std-envvar docutils literal"><span class="pre">SERVER_NAME</span></tt>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.names"> -<tt class="descclassname">server.</tt><tt class="descname">names</tt><a class="headerlink" href="#apache.server.names" title="Permalink to this definition">¶</a></dt> -<dd><p>Tuple. List of normal server names specified in the <tt class="docutils literal"><span class="pre">ServerAlias</span></tt> -directive. This list does not include wildcarded names, which are -listed separately in <tt class="docutils literal"><span class="pre">wild_names</span></tt>. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.wild_names"> -<tt class="descclassname">server.</tt><tt class="descname">wild_names</tt><a class="headerlink" href="#apache.server.wild_names" title="Permalink to this definition">¶</a></dt> -<dd><p>Tuple. List of wildcarded server names specified in the <tt class="docutils literal"><span class="pre">ServerAlias</span></tt> -directive. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.port"> -<tt class="descclassname">server.</tt><tt class="descname">port</tt><a class="headerlink" href="#apache.server.port" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. TCP/IP port number. Same as CGI <span class="target" id="index-23"></span><tt class="xref std std-envvar docutils literal"><span class="pre">SERVER_PORT</span></tt>. -<em>This member appears to be 0 on Apache 2.0, look at -req.connection.local_addr instead</em> <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.error_fname"> -<tt class="descclassname">server.</tt><tt class="descname">error_fname</tt><a class="headerlink" href="#apache.server.error_fname" title="Permalink to this definition">¶</a></dt> -<dd><p>The name of the error log file for this server, if any. -<em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.loglevel"> -<tt class="descclassname">server.</tt><tt class="descname">loglevel</tt><a class="headerlink" href="#apache.server.loglevel" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Logging level. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.is_virtual"> -<tt class="descclassname">server.</tt><tt class="descname">is_virtual</tt><a class="headerlink" href="#apache.server.is_virtual" title="Permalink to this definition">¶</a></dt> -<dd><p>Boolean. True if this is a virtual server. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.timeout"> -<tt class="descclassname">server.</tt><tt class="descname">timeout</tt><a class="headerlink" href="#apache.server.timeout" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Value of the <tt class="docutils literal"><span class="pre">Timeout</span></tt> directive. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.keep_alive_timeout"> -<tt class="descclassname">server.</tt><tt class="descname">keep_alive_timeout</tt><a class="headerlink" href="#apache.server.keep_alive_timeout" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Keepalive timeout. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.keep_alive_max"> -<tt class="descclassname">server.</tt><tt class="descname">keep_alive_max</tt><a class="headerlink" href="#apache.server.keep_alive_max" title="Permalink to this definition">¶</a></dt> -<dd><p>Maximum number of requests per keepalive. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.keep_alive"> -<tt class="descclassname">server.</tt><tt class="descname">keep_alive</tt><a class="headerlink" href="#apache.server.keep_alive" title="Permalink to this definition">¶</a></dt> -<dd><p>Use persistent connections? <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.path"> -<tt class="descclassname">server.</tt><tt class="descname">path</tt><a class="headerlink" href="#apache.server.path" title="Permalink to this definition">¶</a></dt> -<dd><p>String. Path for <tt class="docutils literal"><span class="pre">ServerPath</span></tt> <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.pathlen"> -<tt class="descclassname">server.</tt><tt class="descname">pathlen</tt><a class="headerlink" href="#apache.server.pathlen" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Path length. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.limit_req_line"> -<tt class="descclassname">server.</tt><tt class="descname">limit_req_line</tt><a class="headerlink" href="#apache.server.limit_req_line" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Limit on size of the HTTP request line. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.limit_req_fieldsize"> -<tt class="descclassname">server.</tt><tt class="descname">limit_req_fieldsize</tt><a class="headerlink" href="#apache.server.limit_req_fieldsize" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Limit on size of any request header field. <em>(Read-Only)</em></p> -</dd></dl> - -<dl class="attribute"> -<dt id="apache.server.limit_req_fields"> -<tt class="descclassname">server.</tt><tt class="descname">limit_req_fields</tt><a class="headerlink" href="#apache.server.limit_req_fields" title="Permalink to this definition">¶</a></dt> -<dd><p>Integer. Limit on number of request header fields. <em>(Read-Only)</em></p> -</dd></dl> - -</div> -</div> -</div> -<div class="section" id="module-util"> -<span id="util-miscellaneous-utilities"></span><span id="pyapi-util"></span><h2><a class="reference internal" href="#module-util" title="util: Miscellaneous Utilities."><tt class="xref py py-mod docutils literal"><span class="pre">util</span></tt></a> – Miscellaneous Utilities<a class="headerlink" href="#module-util" title="Permalink to this headline">¶</a></h2> -<p>The <a class="reference internal" href="#module-util" title="util: Miscellaneous Utilities."><tt class="xref py py-mod docutils literal"><span class="pre">util</span></tt></a> module provides a number of utilities handy to a web -application developer similar to those in the standard library -<tt class="xref py py-mod docutils literal"><span class="pre">cgi</span></tt> module. The implementations in the <a class="reference internal" href="#module-util" title="util: Miscellaneous Utilities."><tt class="xref py py-mod docutils literal"><span class="pre">util</span></tt></a> module are -much more efficient because they call directly into Apache API’s as -opposed to using CGI which relies on the environment to pass -information.</p> -<p>The recommended way of using this module is:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">util</span> -</pre></div> -</div> -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><span class="target" id="index-24"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc3875.html"><strong>RFC 3875</strong></a></dt> -<dd>for detailed information on the CGI specification</dd> -</dl> -</div> -<div class="section" id="fieldstorage-class"> -<span id="pyapi-util-fstor"></span><h3>FieldStorage class<a class="headerlink" href="#fieldstorage-class" title="Permalink to this headline">¶</a></h3> -<p>Access to form data is provided via the <a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> -class. This class is similar to the standard library module -<tt class="docutils literal"><span class="pre">cgi.FieldStorage</span></tt></p> -<dl class="class"> -<dt id="util.FieldStorage"> -<em class="property">class </em><tt class="descclassname">util.</tt><tt class="descname">FieldStorage</tt><big>(</big><em>req</em><span class="optional">[</span>, <em>keep_blank_values</em><span class="optional">[</span>, <em>strict_parsing</em><span class="optional">[</span>, <em>file_callback</em><span class="optional">[</span>, <em>field_callback</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#util.FieldStorage" title="Permalink to this definition">¶</a></dt> -<dd><p>This class provides uniform access to HTML form data submitted by -the client. <em>req</em> is an instance of the mod_python -<tt class="xref py py-class docutils literal"><span class="pre">request</span></tt> object.</p> -<p>The optional argument <em>keep_blank_values</em> is a flag indicating -whether blank values in URL encoded form data should be treated as -blank strings. The default is false, which means that blank values -are ignored as if they were not included.</p> -<p>The optional argument <em>strict_parsing</em> is not yet implemented.</p> -<p>The optional argument <em>file_callback</em> allows the application to -override both file creation/deletion semantics and location. See -<a class="reference internal" href="#pyapi-util-fstor-examples"><em>FieldStorage Examples</em></a> for -additional information. <em>New in version 3.2</em></p> -<p>The optional argument <em>field_callback</em> allows the application to -override both the creation/deletion semantics and behavior. <em>New -in version 3.2</em></p> -<p>During initialization, <a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> class reads all of the -data provided by the client. Since all data provided by the client -is consumed at this point, there should be no more than one -<a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> class instantiated per single request, nor -should you make any attempts to read client data before or after -instantiating a <a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a>. A suggested strategy for -dealing with this is that any handler should first check for the -existence of a <tt class="docutils literal"><span class="pre">form</span></tt> attribute within the request object. If -this exists, it should be taken to be an existing instance of the -<a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> class and that should be used. If the -attribute does not exist and needs to be created, it should be -cached as the <tt class="docutils literal"><span class="pre">form</span></tt> attribute of the request object so later -handler code can use it.</p> -<p>When the <a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> class instance is created, the data -read from the client is then parsed into separate fields and -packaged in <a class="reference internal" href="#util.Field" title="util.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> objects, one per field. For HTML form -inputs of type <tt class="docutils literal"><span class="pre">file</span></tt>, a temporary file is created that can later -be accessed via the <a class="reference internal" href="#util.Field.file" title="util.Field.file"><tt class="xref py py-attr docutils literal"><span class="pre">Field.file</span></tt></a> attribute of a -<a class="reference internal" href="#util.Field" title="util.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> object.</p> -<p>The <a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> class has a mapping object interface, -i.e. it can be treated like a dictionary in most instances, but is -not strictly compatible as is it missing some methods provided by -dictionaries and some methods don’t behave entirely like their -counterparts, especially when there is more than one value -associated with a form field. When used as a mapping, the keys are -form input names, and the returned dictionary value can be:</p> -<ul class="simple"> -<li>An instance of <tt class="xref py py-class docutils literal"><span class="pre">StringField</span></tt>, containing the form input -value. This is only when there is a single value corresponding to -the input name. <tt class="xref py py-class docutils literal"><span class="pre">StringField</span></tt> is a subclass of -<tt class="xref py py-class docutils literal"><span class="pre">str</span></tt> which provides the additional -<tt class="xref py py-attr docutils literal"><span class="pre">StringField.value</span></tt> attribute for compatibility with -standard library <tt class="xref py py-mod docutils literal"><span class="pre">cgi</span></tt> module.</li> -<li>An instance of a <a class="reference internal" href="#util.Field" title="util.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> class, if the input is a file -upload.</li> -<li>A list of <tt class="xref py py-class docutils literal"><span class="pre">StringField</span></tt> and/or <a class="reference internal" href="#util.Field" title="util.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> -objects. This is when multiple values exist, such as for a -<tt class="docutils literal"><span class="pre"><select></span></tt> HTML form element.</li> -</ul> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Unlike the standard library <tt class="xref py py-mod docutils literal"><span class="pre">cgi</span></tt> module -<a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> class, a <a class="reference internal" href="#util.Field" title="util.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> object is returned -<em>only</em> when it is a file upload. In all other cases the return -is an instance of <tt class="xref py py-class docutils literal"><span class="pre">StringField</span></tt>. This means that you do -not need to use the <tt class="xref py py-attr docutils literal"><span class="pre">StringFile.value</span></tt> attribute to access -values of fields in most cases.</p> -</div> -<p>In addition to standard mapping object methods, -<a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> objects have the following attributes:</p> -<dl class="attribute"> -<dt id="util.FieldStorage.list"> -<tt class="descname">list</tt><a class="headerlink" href="#util.FieldStorage.list" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a list of <a class="reference internal" href="#util.Field" title="util.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> objects, one for each -input. Multiple inputs with the same name will have multiple -elements in this list.</p> -</dd></dl> - -</dd></dl> - -<div class="section" id="fieldstorage-methods"> -<span id="pyapi-util-fstor-meth"></span><h4><a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> methods<a class="headerlink" href="#fieldstorage-methods" title="Permalink to this headline">¶</a></h4> -<blockquote> -<div><dl class="method"> -<dt id="util.add_field"> -<tt class="descclassname">util.</tt><tt class="descname">add_field</tt><big>(</big><em>name</em>, <em>value</em><big>)</big><a class="headerlink" href="#util.add_field" title="Permalink to this definition">¶</a></dt> -<dd><p>Adds an additional form field with <em>name</em> and <em>value</em>. If a -form field already exists with <em>name</em>, the <em>value</em> will be added -to the list of existing values for the form field. This method -should be used for adding additional fields in preference to -adding new fields direct to the list of fields.</p> -<p>If the value associated with a field should be replaced when it -already exists, rather than an additional value being associated -with the field, the dictionary like subscript operator should be -used to set the value, or the existing field deleted altogether -first using the <tt class="docutils literal"><span class="pre">del</span></tt> operator.</p> -</dd></dl> - -<dl class="method"> -<dt id="util.clear"> -<tt class="descclassname">util.</tt><tt class="descname">clear</tt><big>(</big><big>)</big><a class="headerlink" href="#util.clear" title="Permalink to this definition">¶</a></dt> -<dd><p>Removes all form fields. Individual form fields can be deleted -using the <tt class="docutils literal"><span class="pre">del</span></tt> operator.</p> -</dd></dl> - -<dl class="method"> -<dt id="util.get"> -<tt class="descclassname">util.</tt><tt class="descname">get</tt><big>(</big><em>name</em>, <em>default</em><big>)</big><a class="headerlink" href="#util.get" title="Permalink to this definition">¶</a></dt> -<dd><p>If there is only one value associated with form field <em>name</em>, -that single value will be returned. If there are multiple values, -a list is returned holding all values. If no such form field or -value exists then the method returns the value specified by the -parameter <em>default</em>. A subscript operator is also available -which yields the same result except that an exception will be -raised where the form field <em>name</em> does not exist.</p> -</dd></dl> - -<dl class="method"> -<dt id="util.getfirst"> -<tt class="descclassname">util.</tt><tt class="descname">getfirst</tt><big>(</big><em>name</em><span class="optional">[</span>, <em>default</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#util.getfirst" title="Permalink to this definition">¶</a></dt> -<dd><p>Always returns only one value associated with form field -<em>name</em>. If no such form field or value exists then the method -returns the value specified by the optional parameter -<em>default</em>. This parameter defaults to <tt class="xref docutils literal"><span class="pre">None</span></tt> if not specified.</p> -</dd></dl> - -<dl class="method"> -<dt id="util.getlist"> -<tt class="descclassname">util.</tt><tt class="descname">getlist</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#util.getlist" title="Permalink to this definition">¶</a></dt> -<dd><p>This method always returns a list of values associated with form -field <em>name</em>. The method returns an empty list if no such form -field or value exists for <em>name</em>. It returns a list consisting -of one item if only one such value exists.</p> -</dd></dl> - -<dl class="method"> -<dt id="util.has_key"> -<tt class="descclassname">util.</tt><tt class="descname">has_key</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#util.has_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns <tt class="xref docutils literal"><span class="pre">True</span></tt> if <em>name</em> is a valid form field. The <tt class="docutils literal"><span class="pre">in</span></tt> -operator is also supported and will call this method.</p> -</dd></dl> - -<dl class="method"> -<dt id="util.items"> -<tt class="descclassname">util.</tt><tt class="descname">items</tt><big>(</big><big>)</big><a class="headerlink" href="#util.items" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns a list consisting of tuples for each combination of form -field name and value.</p> -</dd></dl> - -<dl class="method"> -<dt id="util.keys"> -<tt class="descclassname">util.</tt><tt class="descname">keys</tt><big>(</big><big>)</big><a class="headerlink" href="#util.keys" title="Permalink to this definition">¶</a></dt> -<dd><p>This method returns the names of the form fields. The <tt class="docutils literal"><span class="pre">len</span></tt> -operator is also supported and will return the number of names -which would be returned by this method.</p> -</dd></dl> - -</div></blockquote> -</div> -</div> -<div class="section" id="fieldstorage-examples"> -<span id="pyapi-util-fstor-examples"></span><h3>FieldStorage Examples<a class="headerlink" href="#fieldstorage-examples" title="Permalink to this headline">¶</a></h3> -<blockquote> -<div><p>The following examples demonstrate how to use the <em>file_callback</em> -parameter of the <a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> constructor to control file -object creation. The <tt class="xref py py-class docutils literal"><span class="pre">Storage</span></tt> classes created in both -examples derive from FileType, thereby providing extended file -functionality.</p> -<p>These examples are provided for demonstration purposes only. The -issue of temporary file location and security must be considered -when providing such overrides with mod_python in production use.</p> -</div></blockquote> -<div class="section" id="simple-file-control-using-class-constructor"> -<h4>Simple file control using class constructor<a class="headerlink" href="#simple-file-control-using-class-constructor" title="Permalink to this headline">¶</a></h4> -<blockquote> -<div><p>This example uses the <a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> class constructor to -create the file object, allowing simple control. It is not -advisable to add class variables to this if serving multiple -sites from apache. In that case use the factory method instead:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Storage</span><span class="p">(</span><span class="nb">file</span><span class="p">):</span> - - <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">advisory_filename</span><span class="p">):</span> - <span class="bp">self</span><span class="o">.</span><span class="n">advisory_filename</span> <span class="o">=</span> <span class="n">advisory_filename</span> - <span class="bp">self</span><span class="o">.</span><span class="n">delete_on_close</span> <span class="o">=</span> <span class="bp">True</span> - <span class="bp">self</span><span class="o">.</span><span class="n">already_deleted</span> <span class="o">=</span> <span class="bp">False</span> - <span class="bp">self</span><span class="o">.</span><span class="n">real_filename</span> <span class="o">=</span> <span class="s">'/someTempDir/thingy-unique-thingy'</span> - <span class="nb">super</span><span class="p">(</span><span class="n">Storage</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">real_filename</span><span class="p">,</span> <span class="s">'w+b'</span><span class="p">)</span> - - <span class="k">def</span> <span class="nf">close</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> - <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">already_deleted</span><span class="p">:</span> - <span class="k">return</span> - <span class="nb">super</span><span class="p">(</span><span class="n">Storage</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> - <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">delete_on_close</span><span class="p">:</span> - <span class="bp">self</span><span class="o">.</span><span class="n">already_deleted</span> <span class="o">=</span> <span class="bp">True</span> - <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">real_filename</span><span class="p">)</span> - - <span class="n">request_data</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">FieldStorage</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">keep_blank_values</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">file_callback</span><span class="o">=</span><span class="n">Storage</span><span class="p">)</span> -</pre></div> -</div> -</div></blockquote> -</div> -<div class="section" id="advanced-file-control-using-object-factory"> -<h4>Advanced file control using object factory<a class="headerlink" href="#advanced-file-control-using-object-factory" title="Permalink to this headline">¶</a></h4> -<blockquote> -<div><p>Using a object factory can provide greater control over the -constructor parameters:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">os</span> - -<span class="k">class</span> <span class="nc">Storage</span><span class="p">(</span><span class="nb">file</span><span class="p">):</span> - - <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">directory</span><span class="p">,</span> <span class="n">advisory_filename</span><span class="p">):</span> - <span class="bp">self</span><span class="o">.</span><span class="n">advisory_filename</span> <span class="o">=</span> <span class="n">advisory_filename</span> - <span class="bp">self</span><span class="o">.</span><span class="n">delete_on_close</span> <span class="o">=</span> <span class="bp">True</span> - <span class="bp">self</span><span class="o">.</span><span class="n">already_deleted</span> <span class="o">=</span> <span class="bp">False</span> - <span class="bp">self</span><span class="o">.</span><span class="n">real_filename</span> <span class="o">=</span> <span class="n">directory</span> <span class="o">+</span> <span class="s">'/thingy-unique-thingy'</span> - <span class="nb">super</span><span class="p">(</span><span class="n">Storage</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">real_filename</span><span class="p">,</span> <span class="s">'w+b'</span><span class="p">)</span> - - <span class="k">def</span> <span class="nf">close</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> - <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">already_deleted</span><span class="p">:</span> - <span class="k">return</span> - <span class="nb">super</span><span class="p">(</span><span class="n">Storage</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> - <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">delete_on_close</span><span class="p">:</span> - <span class="bp">self</span><span class="o">.</span><span class="n">already_deleted</span> <span class="o">=</span> <span class="bp">True</span> - <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">real_filename</span><span class="p">)</span> - -<span class="k">class</span> <span class="nc">StorageFactory</span><span class="p">:</span> - - <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">directory</span><span class="p">):</span> - <span class="bp">self</span><span class="o">.</span><span class="n">dir</span> <span class="o">=</span> <span class="n">directory</span> - - <span class="k">def</span> <span class="nf">create</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">advisory_filename</span><span class="p">):</span> - <span class="k">return</span> <span class="n">Storage</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">dir</span><span class="p">,</span> <span class="n">advisory_filename</span><span class="p">)</span> - -<span class="n">file_factory</span> <span class="o">=</span> <span class="n">StorageFactory</span><span class="p">(</span><span class="n">someDirectory</span><span class="p">)</span> -<span class="c"># [...sometime later...]</span> -<span class="n">request_data</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">FieldStorage</span><span class="p">(</span><span class="n">request</span><span class="p">,</span> <span class="n">keep_blank_values</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> - <span class="n">file_callback</span><span class="o">=</span><span class="n">file_factory</span><span class="o">.</span><span class="n">create</span><span class="p">)</span> -</pre></div> -</div> -</div></blockquote> -</div> -</div> -<div class="section" id="field-class"> -<span id="pyapi-util-fstor-fld"></span><h3>Field class<a class="headerlink" href="#field-class" title="Permalink to this headline">¶</a></h3> -<dl class="class"> -<dt id="util.Field"> -<em class="property">class </em><tt class="descclassname">util.</tt><tt class="descname">Field</tt><a class="headerlink" href="#util.Field" title="Permalink to this definition">¶</a></dt> -<dd><p>This class is used internally by <a class="reference internal" href="#util.FieldStorage" title="util.FieldStorage"><tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt></a> and is not -meant to be instantiated by the user. Each instance of a -<a class="reference internal" href="#util.Field" title="util.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> class represents an HTML Form input.</p> -<p><a class="reference internal" href="#util.Field" title="util.Field"><tt class="xref py py-class docutils literal"><span class="pre">Field</span></tt></a> instances have the following attributes:</p> -<dl class="attribute"> -<dt id="util.Field.name"> -<tt class="descname">name</tt><a class="headerlink" href="#util.Field.name" title="Permalink to this definition">¶</a></dt> -<dd><p>The input name.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="util.Field.value"> -<tt class="descname">value</tt><a class="headerlink" href="#util.Field.value" title="Permalink to this definition">¶</a></dt> -<dd><p>The input value. This attribute can be used to read data from a -file upload as well, but one has to exercise caution when -dealing with large files since when accessed via <a class="reference internal" href="#util.Field.value" title="util.Field.value"><tt class="xref py py-attr docutils literal"><span class="pre">value</span></tt></a>, -the whole file is read into memory.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="util.Field.file"> -<tt class="descname">file</tt><a class="headerlink" href="#util.Field.file" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a file-like object. For file uploads it points to a -<tt class="xref py py-class docutils literal"><span class="pre">TemporaryFile</span></tt> instance. (For more information see the -TemporaryFile class in the standard python <a class="reference external" href="http://docs.python.org/lib/module-tempfile.html">tempfile module</a>.</p> -<p>For simple values, it is a <tt class="xref py py-class docutils literal"><span class="pre">StringIO</span></tt> object, so you can read -simple string values via this attribute instead of using the <a class="reference internal" href="#util.Field.value" title="util.Field.value"><tt class="xref py py-attr docutils literal"><span class="pre">value</span></tt></a> -attribute as well.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="util.Field.filename"> -<tt class="descname">filename</tt><a class="headerlink" href="#util.Field.filename" title="Permalink to this definition">¶</a></dt> -<dd><p>The name of the file as provided by the client.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="util.Field.type"> -<tt class="descname">type</tt><a class="headerlink" href="#util.Field.type" title="Permalink to this definition">¶</a></dt> -<dd><p>The content-type for this input as provided by the client.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="util.Field.type_options"> -<tt class="descname">type_options</tt><a class="headerlink" href="#util.Field.type_options" title="Permalink to this definition">¶</a></dt> -<dd><p>This is what follows the actual content type in the <tt class="docutils literal"><span class="pre">content-type</span></tt> -header provided by the client, if anything. This is a dictionary.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="util.Field.disposition"> -<tt class="descname">disposition</tt><a class="headerlink" href="#util.Field.disposition" title="Permalink to this definition">¶</a></dt> -<dd><p>The value of the first part of the <tt class="docutils literal"><span class="pre">content-disposition</span></tt> header.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="util.Field.disposition_options"> -<tt class="descname">disposition_options</tt><a class="headerlink" href="#util.Field.disposition_options" title="Permalink to this definition">¶</a></dt> -<dd><p>The second part (if any) of the <tt class="docutils literal"><span class="pre">content-disposition</span></tt> header in -the form of a dictionary.</p> -</dd></dl> - -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><span class="target" id="index-25"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc1867.html"><strong>RFC 1867</strong></a></dt> -<dd>Form-based File Upload in HTML for a description of form-based file uploads</dd> -</dl> -</div> -</dd></dl> - -</div> -<div class="section" id="other-functions"> -<span id="pyapi-util-funcs"></span><h3>Other functions<a class="headerlink" href="#other-functions" title="Permalink to this headline">¶</a></h3> -<dl class="function"> -<dt id="util.parse_qs"> -<tt class="descclassname">util.</tt><tt class="descname">parse_qs</tt><big>(</big><em>qs</em><span class="optional">[</span>, <em>keep_blank_values</em><span class="optional">[</span>, <em>strict_parsing</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#util.parse_qs" title="Permalink to this definition">¶</a></dt> -<dd><p>This function is functionally equivalent to the standard library -<tt class="xref py py-func docutils literal"><span class="pre">cgi.parse_qs()</span></tt>, except that it is written in C and is -much faster.</p> -<blockquote> -<div><p>Parse a query string given as a string argument (data of type -<tt class="docutils literal"><span class="pre">application/x-www-form-urlencoded</span></tt>). Data are returned as a -dictionary. The dictionary keys are the unique query variable -names and the values are lists of values for each name.</p> -<p>The optional argument <em>keep_blank_values</em> is a flag indicating -whether blank values in URL encoded queries should be treated as -blank strings. A true value indicates that blanks should be -retained as blank strings. The default false value indicates that -blank values are to be ignored and treated as if they were not -included.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">The <em>strict_parsing</em> argument is not yet implemented.</p> -</div> -</div></blockquote> -</dd></dl> - -<dl class="function"> -<dt id="util.parse_qsl"> -<tt class="descclassname">util.</tt><tt class="descname">parse_qsl</tt><big>(</big><em>qs</em><span class="optional">[</span>, <em>keep_blank_values</em><span class="optional">[</span>, <em>strict_parsing</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#util.parse_qsl" title="Permalink to this definition">¶</a></dt> -<dd><p>This function is functionally equivalent to the standard library -<tt class="xref py py-func docutils literal"><span class="pre">cgi.parse_qsl()</span></tt>, except that it is written in C and is much -faster.</p> -<blockquote> -<div><p>Parse a query string given as a string argument (data of type -<tt class="docutils literal"><span class="pre">application/x-www-form-urlencoded</span></tt>). Data are returned as a -list of name, value pairs.</p> -<p>The optional argument <em>keep_blank_values</em> is a flag indicating -whether blank values in URL encoded queries should be treated as -blank strings. A true value indicates that blanks should be -retained as blank strings. The default false value indicates that -blank values are to be ignored and treated as if they were not -included.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">The <em>strict_parsing</em> argument is not yet implemented.</p> -</div> -</div></blockquote> -</dd></dl> - -<dl class="function"> -<dt id="util.redirect"> -<tt class="descclassname">util.</tt><tt class="descname">redirect</tt><big>(</big><em>req</em>, <em>location</em><span class="optional">[</span>, <em>permanent=0</em><span class="optional">[</span>, <em>text=None</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#util.redirect" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a convenience function to redirect the browser to another -location. When <em>permanent</em> is true, <tt class="xref py py-const docutils literal"><span class="pre">MOVED_PERMANENTLY</span></tt> -status is sent to the client, otherwise it is -<tt class="xref py py-const docutils literal"><span class="pre">MOVED_TEMPORARILY</span></tt>. A short text is sent to the browser -informing that the document has moved (for those rare browsers that -do not support redirection); this text can be overridden by -supplying a <em>text</em> string.</p> -<blockquote> -<div><p>If this function is called after the headers have already been sent, -an <tt class="xref py py-exc docutils literal"><span class="pre">IOError</span></tt> is raised.</p> -<p>This function raises <tt class="xref py py-exc docutils literal"><span class="pre">apache.SERVER_RETURN</span></tt> exception with a -value of <tt class="xref py py-const docutils literal"><span class="pre">apache.DONE</span></tt> to ensuring that any later phases or -stacked handlers do not run. If you do not want this, you can wrap -the call to <a class="reference internal" href="#util.redirect" title="util.redirect"><tt class="xref py py-func docutils literal"><span class="pre">redirect()</span></tt></a> in a try/except block catching the -<tt class="xref py py-exc docutils literal"><span class="pre">apache.SERVER_RETURN</span></tt>.</p> -</div></blockquote> -</dd></dl> - -</div> -</div> -<div class="section" id="module-Cookie"> -<span id="cookie-http-state-management"></span><span id="pyapi-cookie"></span><h2><a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-mod docutils literal"><span class="pre">Cookie</span></tt></a> – HTTP State Management<a class="headerlink" href="#module-Cookie" title="Permalink to this headline">¶</a></h2> -<p>The <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-mod docutils literal"><span class="pre">Cookie</span></tt></a> module provides convenient ways for creating, -parsing, sending and receiving HTTP Cookies, as defined in the -specification published by Netscape.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p>Even though there are official IETF RFC’s describing HTTP State -Management Mechanism using cookies, the de facto standard supported -by most browsers is the original Netscape specification. -Furthermore, true compliance with IETF standards is actually -incompatible with many popular browsers, even those that claim to -be RFC-compliant. Therefore, this module supports the current -common practice, and is not fully RFC compliant.</p> -<p class="last">More specifically, the biggest difference between Netscape and RFC -cookies is that RFC cookies are sent from the browser to the server -along with their attributes (like Path or Domain). The -<a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-mod docutils literal"><span class="pre">Cookie</span></tt></a> module ignore those incoming attributes, so all -incoming cookies end up as Netscape-style cookies, without any of -their attributes defined.</p> -</div> -<div class="admonition-see-also admonition seealso"> -<p class="first admonition-title">See also</p> -<dl class="last docutils"> -<dt><a class="reference external" href="http://web.archive.org/web/20070202195439/http://wp.netscape.com/newsref/std/cookie_spec.html">Persistent Client State - HTTP Cookies</a></dt> -<dd>for the original Netscape specification.</dd> -<dt><span class="target" id="index-26"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2109.html"><strong>RFC 2109</strong></a></dt> -<dd>HTTP State Management Mechanism for the first RFC on Cookies.</dd> -<dt><span class="target" id="index-27"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2694.html"><strong>RFC 2694</strong></a></dt> -<dd>Use of HTTP State Management for guidelines on using Cookies.</dd> -<dt><span class="target" id="index-28"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2965.html"><strong>RFC 2965</strong></a></dt> -<dd>HTTP State Management Mechanism for the latest IETF standard.</dd> -<dt><a class="reference external" href="http://arxiv.org/abs/cs.SE/0105018">HTTP Cookies: Standards, Privacy, and Politics</a></dt> -<dd>by David M. Kristol for an excellent overview of the issues surrounding standardization of Cookies.</dd> -</dl> -</div> -<div class="section" id="classes"> -<span id="pyapi-cookie-classes"></span><h3>Classes<a class="headerlink" href="#classes" title="Permalink to this headline">¶</a></h3> -<dl class="class"> -<dt id="Cookie.Cookie"> -<em class="property">class </em><tt class="descclassname">Cookie.</tt><tt class="descname">Cookie</tt><big>(</big><em>name</em>, <em>value</em><span class="optional">[</span>, <em>attributes</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#Cookie.Cookie" title="Permalink to this definition">¶</a></dt> -<dd><p>This class is used to construct a single cookie named <em>name</em> and -having <em>value</em> as the value. Additionally, any of the attributes -defined in the Netscape specification and RFC2109 can by supplied -as keyword arguments.</p> -<p>The attributes of the class represent cookie attributes, and their -string representations become part of the string representation of -the cookie. The <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> class restricts attribute names to -only valid values, specifically, only the following attributes are -allowed: <tt class="docutils literal"><span class="pre">name,</span> <span class="pre">value,</span> <span class="pre">version,</span> <span class="pre">path,</span> <span class="pre">domain,</span> <span class="pre">secure,</span> <span class="pre">comment,</span> <span class="pre">expires,</span> <span class="pre">max_age,</span> <span class="pre">commentURL,</span> <span class="pre">discard,</span> <span class="pre">port,</span> <span class="pre">httponly,</span> <span class="pre">__data__</span></tt>.</p> -<p>The <tt class="docutils literal"><span class="pre">__data__</span></tt> attribute is a general-purpose dictionary that can -be used for storing arbitrary values, when necessary (This is -useful when subclassing <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a>).</p> -<p>The <tt class="xref py py-attr docutils literal"><span class="pre">expires</span></tt> attribute is a property whose value is checked -upon setting to be in format <tt class="docutils literal"><span class="pre">'Wdy,</span> <span class="pre">DD-Mon-YYYY</span> <span class="pre">HH:MM:SS</span> <span class="pre">GMT'</span></tt> -(as dictated per Netscape cookie specification), or a numeric value -representing time in seconds since beginning of epoch (which will -be automatically correctly converted to GMT time string). An -invalid <tt class="docutils literal"><span class="pre">expires</span></tt> value will raise <tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt>.</p> -<p>When converted to a string, a <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> will be in correct -format usable as value in a <tt class="docutils literal"><span class="pre">'Cookie'</span></tt> or <tt class="docutils literal"><span class="pre">'Set-Cookie'</span></tt> -header.</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Unlike the Python Standard Library Cookie classes, this class -represents a single cookie (referred to as <em class="dfn">Morsel</em> in -Python Standard Library).</p> -</div> -<dl class="method"> -<dt id="Cookie.Cookie.parse"> -<tt class="descname">parse</tt><big>(</big><em>string</em><big>)</big><a class="headerlink" href="#Cookie.Cookie.parse" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a class method that can be used to create a -<a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> instance from a cookie string <em>string</em> as -passed in a header value. During parsing, attribute names are -converted to lower case.</p> -<p>Because this is a class method, it must be called explicitly -specifying the class.</p> -<p>This method returns a dictionary of <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> instances, -not a single <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> instance.</p> -<p>Here is an example of getting a single <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> instance:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">mycookies</span> <span class="o">=</span> <span class="n">Cookie</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="s">"spam=eggs; expires=Sat, 14-Jun-2003 02:42:36 GMT"</span><span class="p">)</span> -<span class="n">spamcookie</span> <span class="o">=</span> <span class="n">mycookies</span><span class="p">[</span><span class="s">"spam"</span><span class="p">]</span> -</pre></div> -</div> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Because this method uses a dictionary, it is not possible to -have duplicate cookies. If you would like to have more than -one value in a single cookie, consider using a -<a class="reference internal" href="#Cookie.MarshalCookie" title="Cookie.MarshalCookie"><tt class="xref py py-class docutils literal"><span class="pre">MarshalCookie</span></tt></a>.</p> -</div> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="Cookie.SignedCookie"> -<em class="property">class </em><tt class="descclassname">Cookie.</tt><tt class="descname">SignedCookie</tt><big>(</big><em>name</em>, <em>value</em>, <em>secret</em><span class="optional">[</span>, <em>attributes</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#Cookie.SignedCookie" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a subclass of <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a>. This class creates cookies -whose name and value are automatically signed using HMAC (md5) with -a provided secret <em>secret</em>, which must be a non-empty string.</p> -<dl class="method"> -<dt id="Cookie.SignedCookie.parse"> -<tt class="descname">parse</tt><big>(</big><em>string</em>, <em>secret</em><big>)</big><a class="headerlink" href="#Cookie.SignedCookie.parse" title="Permalink to this definition">¶</a></dt> -<dd><p>This method acts the same way as <a class="reference internal" href="#Cookie.Cookie.parse" title="Cookie.Cookie.parse"><tt class="xref py py-class docutils literal"><span class="pre">Cookie.parse()</span></tt></a>, but -also verifies that the cookie is correctly signed. If the -signature cannot be verified, the object returned will be of -class <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a>:</p> -<div class="highlight-python"><pre>.. note::</pre> -</div> -<blockquote> -<div><p>Always check the types of objects returned by -:meth:SignedCookie.parse(). If it is an instance of -<a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> (as opposed to <a class="reference internal" href="#Cookie.SignedCookie" title="Cookie.SignedCookie"><tt class="xref py py-class docutils literal"><span class="pre">SignedCookie</span></tt></a>), the -signature verification has failed:</p> -<div class="highlight-python"><pre># assume spam is supposed to be a signed cookie -if type(spam) is not Cookie.SignedCookie: - # do something that indicates cookie isn't signed correctly</pre> -</div> -</div></blockquote> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="Cookie.MarshalCookie"> -<em class="property">class </em><tt class="descclassname">Cookie.</tt><tt class="descname">MarshalCookie</tt><big>(</big><em>name</em>, <em>value</em>, <em>secret</em><span class="optional">[</span>, <em>attributes</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#Cookie.MarshalCookie" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a subclass of <a class="reference internal" href="#Cookie.SignedCookie" title="Cookie.SignedCookie"><tt class="xref py py-class docutils literal"><span class="pre">SignedCookie</span></tt></a>. It allows for <em>value</em> -to be any marshallable objects. Core Python types such as string, -integer, list, etc. are all marshallable object. For a complete -list see <a class="reference external" href="http://www.python.org/doc/current/lib/module-marshal.html">marchal</a> -module documentation.</p> -<p>When parsing, the signature is checked first, so incorrectly signed -cookies will not be unmarshalled.</p> -</dd></dl> - -<div class="section" id="pyapi-cookie-func"> -<span id="id1"></span><h4>Functions<a class="headerlink" href="#pyapi-cookie-func" title="Permalink to this headline">¶</a></h4> -<dl class="function"> -<dt id="Cookie.add_cookie"> -<tt class="descclassname">Cookie.</tt><tt class="descname">add_cookie</tt><big>(</big><em>req</em>, <em>cookie</em><span class="optional">[</span>, <em>value</em>, <em>attributes</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#Cookie.add_cookie" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a convenience function for setting a cookie in request -headers. <em>req</em> is a mod_python <tt class="xref py py-class docutils literal"><span class="pre">Request</span></tt> object. If -<em>cookie</em> is an instance of <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> (or subclass thereof), -then the cookie is set, otherwise, <em>cookie</em> must be a string, in -which case a <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> is constructed using <em>cookie</em> as -name, <em>value</em> as the value, along with any valid <a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> -attributes specified as keyword arguments.</p> -<p>This function will also set <tt class="docutils literal"><span class="pre">'Cache-Control:</span> <span class="pre">no-cache="set-cookie"'</span></tt> -header to inform caches that the cookie value should not be cached.</p> -<p>Here is one way to use this function:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span> <span class="o">=</span> <span class="n">Cookie</span><span class="o">.</span><span class="n">Cookie</span><span class="p">(</span><span class="s">'spam'</span><span class="p">,</span> <span class="s">'eggs'</span><span class="p">,</span> <span class="n">expires</span><span class="o">=</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span><span class="o">+</span><span class="mi">300</span><span class="p">)</span> -<span class="n">Cookie</span><span class="o">.</span><span class="n">add_cookie</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">c</span><span class="p">)</span> -</pre></div> -</div> -<p>Here is another:</p> -<blockquote> -<div>Cookie.add_cookie(req, ‘spam’, ‘eggs’, expires=time.time()+300)</div></blockquote> -</dd></dl> - -<dl class="function"> -<dt id="Cookie.get_cookies"> -<tt class="descclassname">Cookie.</tt><tt class="descname">get_cookies</tt><big>(</big><em>req</em><span class="optional">[</span>, <em>Class</em><span class="optional">[</span>, <em>data</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Cookie.get_cookies" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a convenience function for retrieving cookies from incoming -headers. <em>req</em> is a mod_python <tt class="xref py py-class docutils literal"><span class="pre">Request</span></tt> object. <em>Class</em> -is a class whose <tt class="xref py py-meth docutils literal"><span class="pre">parse()</span></tt> method will be used to parse the -cookies, it defaults to <tt class="docutils literal"><span class="pre">Cookie</span></tt>. <em>data</em> can be any number of -keyword arguments which, will be passed to <tt class="xref py py-meth docutils literal"><span class="pre">parse()</span></tt> (This -is useful for <tt class="xref py py-class docutils literal"><span class="pre">signedCookie</span></tt> and <a class="reference internal" href="#Cookie.MarshalCookie" title="Cookie.MarshalCookie"><tt class="xref py py-class docutils literal"><span class="pre">MarshalCookie</span></tt></a> -which require <tt class="docutils literal"><span class="pre">secret</span></tt> as an additional argument to -<tt class="xref py py-meth docutils literal"><span class="pre">parse()</span></tt>). The set of cookies found is returned as a -dictionary.</p> -</dd></dl> - -<dl class="function"> -<dt id="Cookie.get_cookie"> -<tt class="descclassname">Cookie.</tt><tt class="descname">get_cookie</tt><big>(</big><em>req</em>, <em>name</em><span class="optional">[</span>, <em>Class</em><span class="optional">[</span>, <em>data</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Cookie.get_cookie" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a convenience function for retrieving a single named cookie -from incoming headers. <em>req</em> is a mod_python <tt class="xref py py-class docutils literal"><span class="pre">Request</span></tt> -object. <em>name</em> is the name of the cookie. <em>Class</em> is a class -whose <tt class="xref py py-meth docutils literal"><span class="pre">parse()</span></tt> method will be used to parse the cookies, it -defaults to <tt class="docutils literal"><span class="pre">Cookie</span></tt>. <em>Data</em> can be any number of keyword -arguments which, will be passed to <tt class="xref py py-meth docutils literal"><span class="pre">parse()</span></tt> (This is useful -for <tt class="xref py py-class docutils literal"><span class="pre">signedCookie</span></tt> and <a class="reference internal" href="#Cookie.MarshalCookie" title="Cookie.MarshalCookie"><tt class="xref py py-class docutils literal"><span class="pre">MarshalCookie</span></tt></a> which require -<tt class="docutils literal"><span class="pre">secret</span></tt> as an additional argument to <tt class="xref py py-meth docutils literal"><span class="pre">parse()</span></tt>). The cookie -if found is returned, otherwise <tt class="xref docutils literal"><span class="pre">None</span></tt> is returned.</p> -</dd></dl> - -</div> -</div> -<div class="section" id="examples"> -<span id="pyapi-cookie-example"></span><h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> -<p>This example sets a simple cookie which expires in 300 seconds:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">Cookie</span><span class="p">,</span> <span class="n">apache</span> -<span class="kn">import</span> <span class="nn">time</span> - -<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - - <span class="n">cookie</span> <span class="o">=</span> <span class="n">Cookie</span><span class="o">.</span><span class="n">Cookie</span><span class="p">(</span><span class="s">'eggs'</span><span class="p">,</span> <span class="s">'spam'</span><span class="p">)</span> - <span class="n">cookie</span><span class="o">.</span><span class="n">expires</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">+</span> <span class="mi">300</span> - <span class="n">Cookie</span><span class="o">.</span><span class="n">add_cookie</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">cookie</span><span class="p">)</span> - - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'This response contains a cookie!</span><span class="se">\n</span><span class="s">'</span><span class="p">)</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -<p>This example checks for incoming marshal cookie and displays it to the -client. If no incoming cookie is present a new marshal cookie is set. -This example uses <tt class="docutils literal"><span class="pre">'secret007'</span></tt> as the secret for HMAC signature:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span><span class="p">,</span> <span class="n">Cookie</span> - -<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - - <span class="n">cookies</span> <span class="o">=</span> <span class="n">Cookie</span><span class="o">.</span><span class="n">get_cookies</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">Cookie</span><span class="o">.</span><span class="n">MarshalCookie</span><span class="p">,</span> - <span class="n">secret</span><span class="o">=</span><span class="s">'secret007'</span><span class="p">)</span> - <span class="k">if</span> <span class="n">cookies</span><span class="o">.</span><span class="n">has_key</span><span class="p">(</span><span class="s">'spam'</span><span class="p">):</span> - <span class="n">spamcookie</span> <span class="o">=</span> <span class="n">cookies</span><span class="p">[</span><span class="s">'spam'</span><span class="p">]</span> - - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'Great, a spam cookie was found: </span><span class="si">%s</span><span class="se">\n</span><span class="s">'</span> \ - <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">spamcookie</span><span class="p">))</span> - <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">spamcookie</span><span class="p">)</span> <span class="ow">is</span> <span class="n">Cookie</span><span class="o">.</span><span class="n">MarshalCookie</span><span class="p">:</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'Here is what it looks like decoded: </span><span class="si">%s</span><span class="s">=</span><span class="si">%s</span><span class="se">\n</span><span class="s">'</span> - <span class="o">%</span> <span class="p">(</span><span class="n">spamcookie</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">spamcookie</span><span class="o">.</span><span class="n">value</span><span class="p">))</span> - <span class="k">else</span><span class="p">:</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'WARNING: The cookie found is not a </span><span class="se">\</span> -<span class="s"> MarshalCookie, it may have been tapered with!'</span><span class="p">)</span> - - <span class="k">else</span><span class="p">:</span> - - <span class="c"># MarshaCookie allows value to be any marshallable object</span> - <span class="n">value</span> <span class="o">=</span> <span class="p">{</span><span class="s">'egg_count'</span><span class="p">:</span> <span class="mi">32</span><span class="p">,</span> <span class="s">'color'</span><span class="p">:</span> <span class="s">'white'</span><span class="p">}</span> - <span class="n">Cookie</span><span class="o">.</span><span class="n">add_cookie</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">Cookie</span><span class="o">.</span><span class="n">MarshalCookie</span><span class="p">(</span><span class="s">'spam'</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> \ - <span class="s">'secret007'</span><span class="p">))</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'Spam cookie not found, but we just set one!</span><span class="se">\n</span><span class="s">'</span><span class="p">)</span> - - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -</div> -</div> -<div class="section" id="module-Session"> -<span id="session-session-management"></span><span id="pyapi-sess"></span><h2><a class="reference internal" href="#module-Session" title="Session: Session Management"><tt class="xref py py-mod docutils literal"><span class="pre">Session</span></tt></a> – Session Management<a class="headerlink" href="#module-Session" title="Permalink to this headline">¶</a></h2> -<p>The <a class="reference internal" href="#module-Session" title="Session: Session Management"><tt class="xref py py-mod docutils literal"><span class="pre">Session</span></tt></a> module provides objects for maintaining persistent -sessions across requests.</p> -<p>The module contains a <a class="reference internal" href="#Session.BaseSession" title="Session.BaseSession"><tt class="xref py py-class docutils literal"><span class="pre">BaseSession</span></tt></a> class, which is not meant -to be used directly (it provides no means of storing a session), -<a class="reference internal" href="#Session.DbmSession" title="Session.DbmSession"><tt class="xref py py-class docutils literal"><span class="pre">DbmSession</span></tt></a> class, which uses a dbm to store sessions, and -<a class="reference internal" href="#Session.FileSession" title="Session.FileSession"><tt class="xref py py-class docutils literal"><span class="pre">FileSession</span></tt></a> class, which uses individual files to store -sessions.</p> -<p>The <a class="reference internal" href="#Session.BaseSession" title="Session.BaseSession"><tt class="xref py py-class docutils literal"><span class="pre">BaseSession</span></tt></a> class also provides session locking, both -across processes and threads. For locking it uses APR global_mutexes -(a number of them is pre-created at startup) The mutex number is -computed by using modulus of the session id <tt class="xref py py-func docutils literal"><span class="pre">hash()</span></tt>. (Therefore -it’s possible that different session id’s will have the same hash, but -the only implication is that those two sessions cannot be locked at -the same time resulting in a slight delay.)</p> -<div class="section" id="pyapi-sess-classes"> -<span id="id2"></span><h3>Classes<a class="headerlink" href="#pyapi-sess-classes" title="Permalink to this headline">¶</a></h3> -<dl class="function"> -<dt id="Session.Session"> -<tt class="descclassname">Session.</tt><tt class="descname">Session</tt><big>(</big><em>req</em><span class="optional">[</span>, <em>sid</em><span class="optional">[</span>, <em>secret</em><span class="optional">[</span>, <em>timeout</em><span class="optional">[</span>, <em>lock</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Session.Session" title="Permalink to this definition">¶</a></dt> -<dd><p><a class="reference internal" href="#module-Session" title="Session: Session Management"><tt class="xref py py-func docutils literal"><span class="pre">Session()</span></tt></a> takes the same arguments as <a class="reference internal" href="#Session.BaseSession" title="Session.BaseSession"><tt class="xref py py-class docutils literal"><span class="pre">BaseSession</span></tt></a>.</p> -<p>This function returns a instance of the default session class. The -session class to be used can be specified using <tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.session.session_type</span> <span class="pre">value</span></tt>, -where <em>value</em> is one of -<a class="reference internal" href="#Session.DbmSession" title="Session.DbmSession"><tt class="xref py py-class docutils literal"><span class="pre">DbmSession</span></tt></a>, <a class="reference internal" href="#Session.MemorySession" title="Session.MemorySession"><tt class="xref py py-class docutils literal"><span class="pre">MemorySession</span></tt></a> or -<a class="reference internal" href="#Session.FileSession" title="Session.FileSession"><tt class="xref py py-class docutils literal"><span class="pre">FileSession</span></tt></a>. Specifying custom session classes using -<tt class="docutils literal"><span class="pre">PythonOption</span></tt> session is not yet supported.</p> -<p>If session type option is not found, the function queries the MPM -and based on that returns either a new instance of -<a class="reference internal" href="#Session.DbmSession" title="Session.DbmSession"><tt class="xref py py-class docutils literal"><span class="pre">DbmSession</span></tt></a> or -<a class="reference internal" href="#Session.MemorySession" title="Session.MemorySession"><tt class="xref py py-class docutils literal"><span class="pre">MemorySession</span></tt></a>. <a class="reference internal" href="#Session.MemorySession" title="Session.MemorySession"><tt class="xref py py-class docutils literal"><span class="pre">MemorySession</span></tt></a> will be used if the -MPM is threaded and not forked (such is the case on Windows), or if -it threaded, forked, but only one process is allowed (the worker -MPM can be configured to run this way). In all other cases -<a class="reference internal" href="#Session.DbmSession" title="Session.DbmSession"><tt class="xref py py-class docutils literal"><span class="pre">DbmSession</span></tt></a> is used.</p> -<p>Note that on Windows if you are using multiple Python interpreter -instances and you need sessions to be shared between applications -running within the context of the distinct Python interpreter -instances, you must specifically indicate that <a class="reference internal" href="#Session.DbmSession" title="Session.DbmSession"><tt class="xref py py-class docutils literal"><span class="pre">DbmSession</span></tt></a> -should be used, as <a class="reference internal" href="#Session.MemorySession" title="Session.MemorySession"><tt class="xref py py-class docutils literal"><span class="pre">MemorySession</span></tt></a> will only allow a session -to be valid within the context of the same Python interpreter -instance.</p> -<p>Also note that the option name <tt class="docutils literal"><span class="pre">mod_python.session.session_type</span></tt> -only started to be used from mod_python 3.3 onwards. If you need to -retain compatibility with older versions of mod_python, you should -use the now obsolete <tt class="docutils literal"><span class="pre">session</span></tt> option instead.</p> -</dd></dl> - -<dl class="class"> -<dt id="Session.BaseSession"> -<em class="property">class </em><tt class="descclassname">Session.</tt><tt class="descname">BaseSession</tt><big>(</big><em>req</em><span class="optional">[</span>, <em>sid</em><span class="optional">[</span>, <em>secret</em><span class="optional">[</span>, <em>timeout</em><span class="optional">[</span>, <em>lock</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Session.BaseSession" title="Permalink to this definition">¶</a></dt> -<dd><p>This class is meant to be used as a base class for other classes -that implement a session storage mechanism. <em>req</em> is a required -reference to a mod_python request object.</p> -<p><a class="reference internal" href="#Session.BaseSession" title="Session.BaseSession"><tt class="xref py py-class docutils literal"><span class="pre">BaseSession</span></tt></a> is a subclass of <tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt>. Data can be -stored and retrieved from the session by using it as a dictionary.</p> -<p><em>sid</em> is an optional session id; if provided, such a session must -already exist, otherwise it is ignored and a new session with a new -sid is created. If <em>sid</em> is not provided, the object will attempt -to look at cookies for session id. If a sid is found in cookies, -but it is not previously known or the session has expired, then a -new sid is created. Whether a session is “new” can be determined -by calling the <a class="reference internal" href="#Session.BaseSession.is_new" title="Session.BaseSession.is_new"><tt class="xref py py-meth docutils literal"><span class="pre">is_new()</span></tt></a> method.</p> -<p>Cookies generated by sessions will have a path attribute which is -calculated by comparing the server <tt class="docutils literal"><span class="pre">DocumentRoot</span></tt> and the -directory in which the <tt class="docutils literal"><span class="pre">PythonHandler</span></tt> directive currently in -effect was specified. E.g. if document root is <tt class="file docutils literal"><span class="pre">/a/b/c</span></tt> and -the directory <tt class="docutils literal"><span class="pre">PythonHandler</span></tt> was specified was <tt class="file docutils literal"><span class="pre">/a/b/c/d/e</span></tt>, -the path will be set to <tt class="file docutils literal"><span class="pre">/d/e</span></tt>.</p> -<p>The deduction of the path in this way will only work though where -the <tt class="docutils literal"><span class="pre">Directory</span></tt> directive is used and the directory is actually -within the document root. If the <tt class="docutils literal"><span class="pre">Location</span></tt> directive is used or -the directory is outside of the document root, the path will be set -to <tt class="file docutils literal"><span class="pre">/</span></tt>. You can force a specific path by setting the -<tt class="docutils literal"><span class="pre">mod_python.session.application_path</span></tt> option -(<tt class="docutils literal"><span class="pre">'PythonOption</span> <span class="pre">mod_python.session.application_path</span> <span class="pre">/my/path'</span></tt> in server -configuration).</p> -<p>Note that prior to mod_python 3.3, the option was -<tt class="docutils literal"><span class="pre">ApplicationPath</span></tt>. If your system needs to be compatible with -older versions of mod_python, you should continue to use the now -obsolete option name.</p> -<p>The domain of a cookie is by default not set for a session and as -such the session is only valid for the host which generated it. In -order to have a session which spans across common sub domains, you -can specify the parent domain using the -<tt class="docutils literal"><span class="pre">mod_python.session.application_domain</span></tt> option -(<tt class="docutils literal"><span class="pre">'PythonOption</span> <span class="pre">mod_python.session.application_domain</span> <span class="pre">mod_python.org'</span></tt> in server -configuration).</p> -<p>When a <em>secret</em> is provided, <a class="reference internal" href="#Session.BaseSession" title="Session.BaseSession"><tt class="xref py py-class docutils literal"><span class="pre">BaseSession</span></tt></a> will use -<tt class="xref py py-class docutils literal"><span class="pre">SignedCookie</span></tt> when generating cookies thereby making the -session id almost impossible to fake. The default is to use plain -<a class="reference internal" href="#module-Cookie" title="Cookie: HTTP State Management"><tt class="xref py py-class docutils literal"><span class="pre">Cookie</span></tt></a> (though even if not signed, the session id is -generated to be very difficult to guess).</p> -<p>A session will timeout if it has not been accessed and a save -performed, within the <em>timeout</em> period. Upon a save occurring the -time of last access is updated and the period until the session -will timeout be reset. The default <em>timeout</em> period is 30 -minutes. An attempt to load an expired session will result in a -“new” session.</p> -<p>The <em>lock</em> argument (defaults to 1) indicates whether locking -should be used. When locking is on, only one session object with a -particular session id can be instantiated at a time.</p> -<p>A session is in “new” state when the session id was just generated, -as opposed to being passed in via cookies or the <em>sid</em> argument.</p> -<dl class="method"> -<dt id="Session.BaseSession.is_new"> -<tt class="descname">is_new</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.is_new" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns 1 if this session is new. A session will also be “new” -after an attempt to instantiate an expired or non-existent -session. It is important to use this method to test whether an -attempt to instantiate a session has succeeded, e.g.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">sess</span> <span class="o">=</span> <span class="n">Session</span><span class="p">(</span><span class="n">req</span><span class="p">)</span> -<span class="k">if</span> <span class="n">sess</span><span class="o">.</span><span class="n">is_new</span><span class="p">():</span> - <span class="c"># redirect to login</span> - <span class="n">util</span><span class="o">.</span><span class="n">redirect</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="s">'http://www.mysite.com/login'</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.id"> -<tt class="descname">id</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.id" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns the session id.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.created"> -<tt class="descname">created</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.created" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns the session creation time in seconds since beginning of -epoch.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.last_accessed"> -<tt class="descname">last_accessed</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.last_accessed" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns last access time in seconds since beginning of epoch.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.timeout"> -<tt class="descname">timeout</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.timeout" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns session timeout interval in seconds.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.set_timeout"> -<tt class="descname">set_timeout</tt><big>(</big><em>secs</em><big>)</big><a class="headerlink" href="#Session.BaseSession.set_timeout" title="Permalink to this definition">¶</a></dt> -<dd><p>Set timeout to <em>secs</em>.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.invalidate"> -<tt class="descname">invalidate</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.invalidate" title="Permalink to this definition">¶</a></dt> -<dd><p>This method will remove the session from the persistent store -and also place a header in outgoing headers to invalidate the -session id cookie.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.load"> -<tt class="descname">load</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.load" title="Permalink to this definition">¶</a></dt> -<dd><p>Load the session values from storage.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.save"> -<tt class="descname">save</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.save" title="Permalink to this definition">¶</a></dt> -<dd><p>This method writes session values to storage.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.delete"> -<tt class="descname">delete</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.delete" title="Permalink to this definition">¶</a></dt> -<dd><p>Remove the session from storage.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.init_lock"> -<tt class="descname">init_lock</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.init_lock" title="Permalink to this definition">¶</a></dt> -<dd><p>This method initializes the session lock. There is no need to -ever call this method, it is intended for subclasses that wish -to use an alternative locking mechanism.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.lock"> -<tt class="descname">lock</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.lock" title="Permalink to this definition">¶</a></dt> -<dd><p>Locks this session. If the session is already locked by another -thread/process, wait until that lock is released. There is no -need to call this method if locking is handled automatically -(default).</p> -<p>This method registeres a cleanup which always unlocks the session -at the end of the request processing.</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.unlock"> -<tt class="descname">unlock</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.unlock" title="Permalink to this definition">¶</a></dt> -<dd><p>Unlocks this session. (Same as <a class="reference internal" href="#Session.BaseSession.lock" title="Session.BaseSession.lock"><tt class="xref py py-meth docutils literal"><span class="pre">lock()</span></tt></a> - when locking is -handled automatically (default), there is no need to call this -method).</p> -</dd></dl> - -<dl class="method"> -<dt id="Session.BaseSession.cleanup"> -<tt class="descname">cleanup</tt><big>(</big><big>)</big><a class="headerlink" href="#Session.BaseSession.cleanup" title="Permalink to this definition">¶</a></dt> -<dd><p>This method is for subclasses to implement session storage -cleaning mechanism (i.e. deleting expired sessions, etc.). It -will be called at random, the chance of it being called is -controlled by <tt class="xref py py-const docutils literal"><span class="pre">CLEANUP_CHANCE</span></tt> <a class="reference internal" href="#module-Session" title="Session: Session Management"><tt class="xref py py-mod docutils literal"><span class="pre">Session</span></tt></a> module -variable (default 1000). This means that cleanups will be -ordered at random and there is 1 in 1000 chance of it -happening. Subclasses implementing this method should not -perform the (potentially time consuming) cleanup operation in -this method, but should instead use -:meth:req.register_cleanup` to register a cleanup which will -be executed after the request has been processed.</p> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="Session.DbmSession"> -<em class="property">class </em><tt class="descclassname">Session.</tt><tt class="descname">DbmSession</tt><big>(</big><em>req</em><span class="optional">[</span>, <em>dbm</em><span class="optional">[</span>, <em>sid</em><span class="optional">[</span>, <em>secret</em><span class="optional">[</span>, <em>dbmtype</em><span class="optional">[</span>, <em>timeout</em><span class="optional">[</span>, <em>lock</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Session.DbmSession" title="Permalink to this definition">¶</a></dt> -<dd><p>This class provides session storage using a dbm file. Generally, -dbm access is very fast, and most dbm implementations memory-map -files for faster access, which makes their performance nearly as -fast as direct shared memory access.</p> -<p><em>dbm</em> is the name of the dbm file (the file must be writable by the -httpd process). This file is not deleted when the server process is -stopped (a nice side benefit of this is that sessions can survive -server restarts). By default the session information is stored in a -dbmfile named <tt class="file docutils literal"><span class="pre">mp_sess.dbm</span></tt> and stored in a temporary -directory returned by <tt class="docutils literal"><span class="pre">tempfile.gettempdir()</span></tt> standard library -function. An alternative directory can be specified using -<tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.dbm_session.database_directory</span> <span class="pre">/path/to/directory</span></tt>. -The path and filename can can be overridden by -setting <tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.dbm_session.database_filename</span> <span class="pre">filename</span></tt>.</p> -<p>Note that the above names for the <tt class="docutils literal"><span class="pre">PythonOption</span></tt> settings were -changed to these values in mod_python 3.3. If you need to retain -compatibility with older versions of mod_python, you should -continue to use the now obsolete <tt class="docutils literal"><span class="pre">session_directory</span></tt> and -<tt class="docutils literal"><span class="pre">session_dbm</span></tt> options.</p> -<p>The implementation uses Python <tt class="xref py py-mod docutils literal"><span class="pre">anydbm</span></tt> module, which will -default to <tt class="xref py py-mod docutils literal"><span class="pre">dbhash</span></tt> on most systems. If you need to use a -specific dbm implementation (e.g. <tt class="xref py py-mod docutils literal"><span class="pre">gdbm</span></tt>), you can pass that -module as <em>dbmtype</em>.</p> -<p>Note that using this class directly is not cross-platform. For best -compatibility across platforms, always use the <a class="reference internal" href="#module-Session" title="Session: Session Management"><tt class="xref py py-func docutils literal"><span class="pre">Session()</span></tt></a> -function to create sessions.</p> -</dd></dl> - -<dl class="class"> -<dt id="Session.FileSession"> -<em class="property">class </em><tt class="descclassname">Session.</tt><tt class="descname">FileSession</tt><big>(</big><em>req</em><span class="optional">[</span>, <em>sid</em><span class="optional">[</span>, <em>secret</em><span class="optional">[</span>, <em>timeout</em><span class="optional">[</span>, <em>lock</em><span class="optional">[</span>, <em>fast_cleanup</em><span class="optional">[</span>, <em>verify_cleanup</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Session.FileSession" title="Permalink to this definition">¶</a></dt> -<dd><p>New in version 3.2.0.</p> -<p>This class provides session storage using a separate file for each -session. It is a subclass of <tt class="xref py py-mod docutils literal"><span class="pre">BaseSession</span></tt>.</p> -<p>Session data is stored in a separate file for each session. These -files are not deleted when the server process is stopped, so -sessions are persistent across server restarts. The session files -are saved in a directory named mp_sess in the temporary directory -returned by the <tt class="docutils literal"><span class="pre">tempfile.gettempdir()</span></tt> standard library -function. An alternate path can be set using -<tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.file_session.database_directory</span> <span class="pre">/path/to/directory</span></tt>. -This directory must exist and be readable and writeable by the apache process.</p> -<p>Note that the above name for the <tt class="docutils literal"><span class="pre">PythonOption</span></tt> setting was -changed to these values in mod_python 3.3. If you need to retain -compatibility with older versions of mod_python, you should -continue to use the now obsolete <tt class="docutils literal"><span class="pre">session_directory</span></tt> option.</p> -<p>Expired session files are periodically removed by the cleanup mechanism. -The behaviour of the cleanup can be controlled using the -<em>fast_cleanup</em> and <em>verify_cleanup</em> parameters, as well as -<tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.file_session.cleanup_time_limit</span></tt> and -<tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.file_session.cleanup_grace_period</span></tt>.</p> -<ul> -<li><p class="first"><em>fast_cleanup</em></p> -<blockquote> -<div><p>A boolean value used to turn on FileSession cleanup -optimization. Default is <em>True</em> and will result in reduced -cleanup time when there are a large number of session files.</p> -<p>When <em>fast_cleanup</em> is True, the modification time for the -session file is used to determine if it is a candidate for -deletion. If <tt class="docutils literal"><span class="pre">(current_time</span> <span class="pre">-</span> <span class="pre">file_modification_time)</span> <span class="pre">></span> <span class="pre">(timeout</span> <span class="pre">+</span> <span class="pre">grace_period)</span></tt>, -the file will be a candidate for -deletion. If <em>verify_cleanup</em> is False, no futher checks will be -made and the file will be deleted.</p> -</div></blockquote> -<p>If <em>fast_cleanup</em> is False, the session file will unpickled and -it’s timeout value used to determine if the session is a -candidate for deletion. <em>fast_cleanup</em> = <tt class="xref docutils literal"><span class="pre">False</span></tt> implies -<em>verify_cleanup</em> = <tt class="xref docutils literal"><span class="pre">True</span></tt>.</p> -<p>The timeout used in the fast_cleanup calculation is same as the -timeout for the session in the current request running the -filesession_cleanup. If your session objects are not using the -same timeout, or you are manually setting the timeout for a -particular session with <tt class="docutils literal"><span class="pre">set_timeout()</span></tt>, you will need to set -<em>verify_cleanup</em> = <tt class="xref docutils literal"><span class="pre">True</span></tt>.</p> -<p>The value of <em>fast_cleanup</em> can also be set using -<tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.file_session.enable_fast_cleanup</span></tt>.</p> -</li> -<li><p class="first"><em>verify_cleanup</em></p> -<blockquote> -<div><p>Boolean value used to optimize the FileSession cleanup process. -Default is <tt class="xref docutils literal"><span class="pre">True</span></tt>.</p> -<p>If <em>verify_cleanup</em> is True, the session file which is being -considered for deletion will be unpickled and its timeout value -will be used to decide if the file should be deleted.</p> -<p>When <em>verify_cleanup</em> is False, the timeout value for the -current session will be used in to determine if the session has -expired. In this case, the session data will not be read from -disk, which can lead to a substantial performance improvement -when there are a large number of session files, or where each -session is saving a large amount of data. However this may -result in valid sessions being deleted if all the sessions are -not using a the same timeout value.</p> -<p>The value of <em>verify_cleanup</em> can also be set using -<tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.file_session.verify_session_timeout</span></tt>.</p> -</div></blockquote> -</li> -<li><dl class="first docutils"> -<dt><tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.file_session.cleanup_time_limit</span> <span class="pre">[value]</span></tt></dt> -<dd><p class="first last">Integer value in seconds. Default is 2 seconds.</p> -</dd> -</dl> -<p>Session cleanup could potentially take a long time and be both -cpu and disk intensive, depending on the number of session files -and if each file needs to be read to verify the timeout value. To -avoid overloading the server, each time filesession_cleanup is -called it will run for a maximum of <em>session_cleanup_time_limit</em> -seconds. Each cleanup call will resume from where the previous -call left off so all session files will eventually be checked.</p> -<p>Setting <em>session_cleanup_time_limit</em> to 0 will disable this -feature and filesession_cleanup will run to completion each time -it is called.</p> -</li> -<li><p class="first"><tt class="docutils literal"><span class="pre">PythonOption</span> <span class="pre">mod_python.file_session.cleanup_grace_period</span> <span class="pre">[value]</span></tt> -Integer value in seconds. Default is 240 seconds. This value is added -to the session timeout in determining if a session file should be -deleted.</p> -<p>There is a small chance that a the cleanup for a given session -file may occur at the exact time that the session is being -accessed by another request. It is possible under certain -circumstances for that session file to be saved in the other -request only to be immediately deleted by the cleanup. To avoid -this race condition, a session is allowed a <em>grace_period</em> before -it is considered for deletion by the cleanup. As long as the -grace_period is longer that the time it takes to complete the -request (which should normally be less than 1 second), the -session will not be mistakenly deleted by the cleanup.</p> -<p>The default value should be sufficient for most applications.</p> -</li> -</ul> -</dd></dl> - -<dl class="class"> -<dt id="Session.MemorySession"> -<em class="property">class </em><tt class="descclassname">Session.</tt><tt class="descname">MemorySession</tt><big>(</big><em>req</em><span class="optional">[</span>, <em>sid</em><span class="optional">[</span>, <em>secret</em><span class="optional">[</span>, <em>timeout</em><span class="optional">[</span>, <em>lock</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Session.MemorySession" title="Permalink to this definition">¶</a></dt> -<dd><p>This class provides session storage using a global dictionary. This -class provides by far the best performance, but cannot be used in a -multi-process configuration, and also consumes memory for every -active session. It also cannot be used where multiple Python -interpreters are used within the one Apache process and it is -necessary to share sessions between applications running in the -distinct interpreters.</p> -<p>Note that using this class directly is not cross-platform. For best -compatibility across platforms, always use the <a class="reference internal" href="#module-Session" title="Session: Session Management"><tt class="xref py py-func docutils literal"><span class="pre">Session()</span></tt></a> -function to create sessions.</p> -</dd></dl> - -</div> -<div class="section" id="pyapi-sess-example"> -<span id="id3"></span><h3>Examples<a class="headerlink" href="#pyapi-sess-example" title="Permalink to this headline">¶</a></h3> -<p>The following example demonstrates a simple hit counter.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">Session</span> - -<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="n">session</span> <span class="o">=</span> <span class="n">Session</span><span class="o">.</span><span class="n">Session</span><span class="p">(</span><span class="n">req</span><span class="p">)</span> - - <span class="k">try</span><span class="p">:</span> - <span class="n">session</span><span class="p">[</span><span class="s">'hits'</span><span class="p">]</span> <span class="o">+=</span> <span class="mi">1</span> - <span class="k">except</span><span class="p">:</span> - <span class="n">session</span><span class="p">[</span><span class="s">'hits'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span> - - <span class="n">session</span><span class="o">.</span><span class="n">save</span><span class="p">()</span> - - <span class="n">req</span><span class="o">.</span><span class="n">content_type</span> <span class="o">=</span> <span class="s">'text/plain'</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'Hits: </span><span class="si">%d</span><span class="se">\n</span><span class="s">'</span> <span class="o">%</span> <span class="n">session</span><span class="p">[</span><span class="s">'hits'</span><span class="p">])</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -</div> -</div> -<div class="section" id="module-psp"> -<span id="psp-python-server-pager"></span><span id="pyapi-psp"></span><h2><a class="reference internal" href="#module-psp" title="psp: Python Server Pages"><tt class="xref py py-mod docutils literal"><span class="pre">psp</span></tt></a> – Python Server Pager<a class="headerlink" href="#module-psp" title="Permalink to this headline">¶</a></h2> -<p>The <a class="reference internal" href="#module-psp" title="psp: Python Server Pages"><tt class="xref py py-mod docutils literal"><span class="pre">psp</span></tt></a> module provides a way to convert text documents -(including, but not limited to HTML documents) containing Python code -embedded in special brackets into pure Python code suitable for -execution within a mod_python handler, thereby providing a versatile -mechanism for delivering dynamic content in a style similar to ASP, -JSP and others.</p> -<p>The parser used by <a class="reference internal" href="#module-psp" title="psp: Python Server Pages"><tt class="xref py py-mod docutils literal"><span class="pre">psp</span></tt></a> is written in C (generated using flex) -and is therefore very fast.</p> -<p>See <a class="reference internal" href="handlers.html#hand-psp"><em>PSP Handler</em></a> for additional PSP information.</p> -<p>Inside the document, Python <em class="dfn">code</em> needs to be surrounded by -<tt class="docutils literal"><span class="pre">'<%'</span></tt> and <tt class="docutils literal"><span class="pre">'%>'</span></tt>. Python <em class="dfn">expressions</em> are enclosed in -<tt class="docutils literal"><span class="pre">'<%='</span></tt> and <tt class="docutils literal"><span class="pre">'%>'</span></tt>. A <em class="dfn">directive</em> can be enclosed in -<tt class="docutils literal"><span class="pre">'<%@'</span></tt> and <tt class="docutils literal"><span class="pre">'%>'</span></tt>. A comment (which will never be part of -the resulting code) can be enclosed in <tt class="docutils literal"><span class="pre">'<%--'</span></tt> and <tt class="docutils literal"><span class="pre">'--%>'</span></tt></p> -<p>Here is a primitive PSP page that demonstrated use of both code and -expression embedded in an HTML document:</p> -<div class="highlight-python"><pre><html> -<% -import time -%> -Hello world, the time is: <%=time.strftime("%Y-%m-%d, %H:%M:%S")%> -</html></pre> -</div> -<p>Internally, the PSP parser would translate the above page into the -following Python code:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"""<html></span> -<span class="s">"""</span><span class="p">)</span> -<span class="kn">import</span> <span class="nn">time</span> -<span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"""</span> -<span class="s">Hello world, the time is: """</span><span class="p">);</span> <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s">"%Y-%m-</span><span class="si">%d</span><span class="s">, %H:%M:%S"</span><span class="p">)));</span> <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"""</span> -<span class="s"></html></span> -<span class="s">"""</span><span class="p">)</span> -</pre></div> -</div> -<p>This code, when executed inside a handler would result in a page -displaying words <tt class="docutils literal"><span class="pre">'Hello</span> <span class="pre">world,</span> <span class="pre">the</span> <span class="pre">time</span> <span class="pre">is:</span> <span class="pre">'</span></tt> followed by current time.</p> -<p>Python code can be used to output parts of the page conditionally or -in loops. Blocks are denoted from within Python code by -indentation. The last indentation in Python code (even if it is a -comment) will persist through the document until either end of -document or more Python code.</p> -<p>Here is an example:</p> -<div class="highlight-python"><pre><html> -<% -for n in range(3): - # This indent will persist -%> -<p>This paragraph will be -repeated 3 times.</p> -<% -# This line will cause the block to end -%> -This line will only be shown once.<br> -</html></pre> -</div> -<p>The above will be internally translated to the following Python code:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"""<html></span> -<span class="s">"""</span><span class="p">)</span> -<span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">):</span> - <span class="c"># This indent will persist</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"""</span> -<span class="s"><p>This paragraph will be</span> -<span class="s">repeated 3 times.</p></span> -<span class="s">"""</span><span class="p">)</span> -<span class="c"># This line will cause the block to end</span> -<span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"""</span> -<span class="s">This line will only be shown once.<br></span> -<span class="s"></html></span> -<span class="s">"""</span><span class="p">)</span> -</pre></div> -</div> -<p>The parser is also smart enough to figure out the indent if the last -line of Python ends with <tt class="docutils literal"><span class="pre">':'</span></tt> (colon). Considering this, and that the -indent is reset when a newline is encountered inside <tt class="docutils literal"><span class="pre">'<%</span> <span class="pre">%>'</span></tt>, the -above page can be written as:</p> -<div class="highlight-python"><pre><html> -<% -for n in range(3): -%> -<p>This paragraph will be -repeated 3 times.</p> -<% -%> -This line will only be shown once.<br> -</html></pre> -</div> -<p>However, the above code can be confusing, thus having descriptive -comments denoting blocks is highly recommended as a good practice.</p> -<p>The only directive supported at this time is <tt class="docutils literal"><span class="pre">include</span></tt>, here is -how it can be used:</p> -<div class="highlight-python"><pre><%@ include file="/file/to/include"%></pre> -</div> -<p>If the <a class="reference internal" href="#psp.parse" title="psp.parse"><tt class="xref py py-func docutils literal"><span class="pre">parse()</span></tt></a> function was called with the <em>dir</em> argument, then -the file can be specified as a relative path, otherwise it has to be -absolute:</p> -<div class="highlight-python"><pre>.. class:: PSP(req[, filename[, string[, vars]]])</pre> -</div> -<blockquote> -<div><p>This class represents a PSP object.</p> -<p><em>req</em> is a request object; <em>filename</em> and <em>string</em> are optional -keyword arguments which indicate the source of the PSP code. Only -one of these can be specified. If neither is specified, -<tt class="docutils literal"><span class="pre">req.filename</span></tt> is used as <em>filename</em>.</p> -<p><em>vars</em> is a dictionary of global variables. Vars passed in the -<tt class="xref py py-meth docutils literal"><span class="pre">run()</span></tt> method will override vars passed in here.</p> -<p>This class is used internally by the PSP handler, but can also be -used as a general purpose templating tool.</p> -<p>When a file is used as the source, the code object resulting from -the specified file is stored in a memory cache keyed on file name -and file modification time. The cache is global to the Python -interpreter. Therefore, unless the file modification time changes, -the file is parsed and resulting code is compiled only once per -interpreter.</p> -<p>The cache is limited to 512 pages, which depending on the size of -the pages could potentially occupy a significant amount of -memory. If memory is of concern, then you can switch to dbm file -caching. Our simple tests showed only 20% slower performance using -bsd db. You will need to check which implementation <tt class="xref py py-mod docutils literal"><span class="pre">anydbm</span></tt> -defaults to on your system as some dbm libraries impose a limit on -the size of the entry making them unsuitable. Dbm caching can be -enabled via <tt class="docutils literal"><span class="pre">mod_python.psp.cache_database_filename</span></tt> Python -option, e.g.:</p> -<div class="highlight-python"><pre>PythonOption mod_python.psp.cache_database_filename "/tmp/pspcache.dbm"</pre> -</div> -<p>Note that the dbm cache file is not deleted when the server -restarts.</p> -<p>Unlike with files, the code objects resulting from a string are -cached in memory only. There is no option to cache in a dbm file at -this time.</p> -<p>Note that the above name for the option setting was only changed to -this value in mod_python 3.3. If you need to retain backward -compatibility with older versions of mod_python use the -<tt class="docutils literal"><span class="pre">PSPDbmCache</span></tt> option instead.</p> -<dl class="method"> -<dt id="psp.PSP.run"> -<tt class="descclassname">PSP.</tt><tt class="descname">run</tt><big>(</big><span class="optional">[</span><em>vars</em><span class="optional">[</span>, <em>flush</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#psp.PSP.run" title="Permalink to this definition">¶</a></dt> -<dd><p>This method will execute the code (produced at object -initialization time by parsing and compiling the PSP -source). Optional argument <em>vars</em> is a dictionary keyed by -strings that will be passed in as global variables. Optional -argument <em>flush</em> is a boolean flag indicating whether output -should be flushed. The default is not to flush output.</p> -<p>Additionally, the PSP code will be given global variables -<tt class="docutils literal"><span class="pre">req</span></tt>, <tt class="docutils literal"><span class="pre">psp</span></tt>, <tt class="docutils literal"><span class="pre">session</span></tt> and <tt class="docutils literal"><span class="pre">form</span></tt>. A session will be -created and assigned to <tt class="docutils literal"><span class="pre">session</span></tt> variable only if <tt class="docutils literal"><span class="pre">session</span></tt> -is referenced in the code (the PSP handler examines <tt class="docutils literal"><span class="pre">co_names</span></tt> -of the code object to make that determination). Remember that a -mere mention of <tt class="docutils literal"><span class="pre">session</span></tt> will generate cookies and turn on -session locking, which may or may not be what you -want. Similarly, a mod_python <tt class="xref py py-class docutils literal"><span class="pre">FieldStorage</span></tt> object will -be instantiated if <tt class="docutils literal"><span class="pre">form</span></tt> is referenced in the code.</p> -<p>The object passed in <tt class="docutils literal"><span class="pre">psp</span></tt> is an instance of -<a class="reference internal" href="#psp.PSPInterface" title="psp.PSPInterface"><tt class="xref py py-class docutils literal"><span class="pre">PSPInterface</span></tt></a>.</p> -</dd></dl> - -<dl class="method"> -<dt id="psp.PSP.display_code"> -<tt class="descclassname">PSP.</tt><tt class="descname">display_code</tt><big>(</big><big>)</big><a class="headerlink" href="#psp.PSP.display_code" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns an HTML-formatted string representing a side-by-side -listing of the original PSP code and resulting Python code -produced by the PSP parser.</p> -<p>Here is an example of how <tt class="xref py py-class docutils literal"><span class="pre">PSP</span></tt> can be used as a templating -mechanism:</p> -<p>The template file:</p> -<div class="highlight-python"><pre><html> - <!-- This is a simple psp template called template.html --> - <h1>Hello, <%=what%>!</h1> -</html></pre> -</div> -<p>The handler code:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span><span class="p">,</span> <span class="n">psp</span> - -<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="n">template</span> <span class="o">=</span> <span class="n">psp</span><span class="o">.</span><span class="n">PSP</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="s">'template.html'</span><span class="p">)</span> - <span class="n">template</span><span class="o">.</span><span class="n">run</span><span class="p">({</span><span class="s">'what'</span><span class="p">:</span><span class="s">'world'</span><span class="p">})</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -</dd></dl> - -</div></blockquote> -<dl class="class"> -<dt id="psp.PSPInterface"> -<em class="property">class </em><tt class="descclassname">psp.</tt><tt class="descname">PSPInterface</tt><a class="headerlink" href="#psp.PSPInterface" title="Permalink to this definition">¶</a></dt> -<dd><p>An object of this class is passed as a global variable <tt class="docutils literal"><span class="pre">psp</span></tt> to -the PSP code. Objects of this class are instantiated internally and -the interface to <tt class="xref py py-meth docutils literal"><span class="pre">__init__()</span></tt> is purposely undocumented.</p> -<dl class="method"> -<dt id="psp.PSPInterface.set_error_page"> -<tt class="descname">set_error_page</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#psp.PSPInterface.set_error_page" title="Permalink to this definition">¶</a></dt> -<dd><p>Used to set a psp page to be processed when an exception -occurs. If the path is absolute, it will be appended to document -root, otherwise the file is assumed to exist in the same directory -as the current page. The error page will receive one additional -variable, <tt class="docutils literal"><span class="pre">exception</span></tt>, which is a 3-tuple returned by -<tt class="docutils literal"><span class="pre">sys.exc_info()</span></tt>.</p> -</dd></dl> - -<dl class="method"> -<dt id="psp.PSPInterface.apply_data"> -<tt class="descname">apply_data</tt><big>(</big><em>object</em><span class="optional">[</span>, <em>**kw</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#psp.PSPInterface.apply_data" title="Permalink to this definition">¶</a></dt> -<dd><p>This method will call the callable object <em>object</em>, passing form -data as keyword arguments, and return the result.</p> -</dd></dl> - -<dl class="method"> -<dt id="psp.PSPInterface.redirect"> -<tt class="descname">redirect</tt><big>(</big><em>location</em><span class="optional">[</span>, <em>permanent=0</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#psp.PSPInterface.redirect" title="Permalink to this definition">¶</a></dt> -<dd><p>This method will redirect the browser to location -<em>location</em>. If <em>permanent</em> is true, then -<tt class="xref py py-const docutils literal"><span class="pre">MOVED_PERMANENTLY</span></tt> will be sent (as opposed to -<tt class="xref py py-const docutils literal"><span class="pre">MOVED_TEMPORARILY</span></tt>).</p> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">Redirection can only happen before any data is sent to the -client, therefore the Python code block calling this method must -be at the very beginning of the page. Otherwise an -<tt class="xref py py-exc docutils literal"><span class="pre">IOError</span></tt> exception will be raised.</p> -</div> -<p>Example:</p> -<div class="highlight-python"><pre><% - -# note that the '<' above is the first byte of the page! -psp.redirect('http://www.modpython.org') -%></pre> -</div> -</dd></dl> - -</dd></dl> - -<p>Additionally, the <a class="reference internal" href="#module-psp" title="psp: Python Server Pages"><tt class="xref py py-mod docutils literal"><span class="pre">psp</span></tt></a> module provides the following low level -functions:</p> -<dl class="function"> -<dt id="psp.parse"> -<tt class="descclassname">psp.</tt><tt class="descname">parse</tt><big>(</big><em>filename</em><span class="optional">[</span>, <em>dir</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#psp.parse" title="Permalink to this definition">¶</a></dt> -<dd><p>This function will open file named <em>filename</em>, read and parse its -content and return a string of resulting Python code.</p> -<p>If <em>dir</em> is specified, then the ultimate filename to be parsed is -constructed by concatenating <em>dir</em> and <em>filename</em>, and the argument -to <tt class="docutils literal"><span class="pre">include</span></tt> directive can be specified as a relative path. (Note -that this is a simple concatenation, no path separator will be -inserted if <em>dir</em> does not end with one).</p> -</dd></dl> - -<dl class="function"> -<dt id="psp.parsestring"> -<tt class="descclassname">psp.</tt><tt class="descname">parsestring</tt><big>(</big><em>string</em><big>)</big><a class="headerlink" href="#psp.parsestring" title="Permalink to this definition">¶</a></dt> -<dd><p>This function will parse contents of <em>string</em> and return a string -of resulting Python code.</p> -</dd></dl> - -</div> -<div class="section" id="module-httpdconf"> -<span id="httpdconf-httpd-configuration"></span><span id="pyapi-httpdconf"></span><h2><a class="reference internal" href="#module-httpdconf" title="httpdconf: HTTPd Configuration"><tt class="xref py py-mod docutils literal"><span class="pre">httpdconf</span></tt></a> – HTTPd Configuration<a class="headerlink" href="#module-httpdconf" title="Permalink to this headline">¶</a></h2> -<p>The <a class="reference internal" href="#module-httpdconf" title="httpdconf: HTTPd Configuration"><tt class="xref py py-mod docutils literal"><span class="pre">httpdconf</span></tt></a> module provides a simple framework for generating -Apache HTTP Server configuration in Python. It was inspired by HTMLgen -by Robin Friedrich. <a class="reference internal" href="#module-httpdconf" title="httpdconf: HTTPd Configuration"><tt class="xref py py-mod docutils literal"><span class="pre">httpdconf</span></tt></a> appeared in 2002 as part of the -mod_python test framework and its use has been primarily limited to -mod_python tests. This latest version of mod_python includes many -improvements to <a class="reference internal" href="#module-httpdconf" title="httpdconf: HTTPd Configuration"><tt class="xref py py-mod docutils literal"><span class="pre">httpdconf</span></tt></a> and makes it part of the Python API.</p> -<p>The basic idea is that an Apache configuration directive can be -specified as Python code, e.g.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">mod_python.httpdconf</span> <span class="kn">import</span> <span class="o">*</span> -<span class="gp">>>> </span><span class="n">conf</span> <span class="o">=</span> <span class="n">DocumentRoot</span><span class="p">(</span><span class="s">'/path/to/htdocs'</span><span class="p">)</span> -</pre></div> -</div> -<p>The resulting object renders itself as a valid Apache directive when -converted to string:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">print</span> <span class="n">conf</span> -<span class="go">DocumentRoot /path/to/htdocs</span> -</pre></div> -</div> -<p>While the <tt class="docutils literal"><span class="pre">__repr__</span></tt> method of the object returns the string of -Python code used to construct it in the first place:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">print</span> <span class="sb">`conf`</span> -<span class="go">DocumentRoot('/path/to/htdocs')</span> -</pre></div> -</div> -<div class="section" id="classes-for-directive-types"> -<h3>Classes for Directive types<a class="headerlink" href="#classes-for-directive-types" title="Permalink to this headline">¶</a></h3> -<p><a class="reference internal" href="#module-httpdconf" title="httpdconf: HTTPd Configuration"><tt class="xref py py-mod docutils literal"><span class="pre">httpdconf</span></tt></a> separates all Apache directives into the following -classes.</p> -<dl class="class"> -<dt id="httpdconf.Directive"> -<em class="property">class </em><tt class="descclassname">httpdconf.</tt><tt class="descname">Directive</tt><big>(</big><em>name</em>, <em>value</em><span class="optional">[</span>, <em>flipslash=1</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#httpdconf.Directive" title="Permalink to this definition">¶</a></dt> -<dd><p>This is a simple directive. Its syntax is the directive <em>name</em> -followed by a string <em>value</em>. Even though the Apache directives can -be followed by multiple arguments, <a class="reference internal" href="#module-httpdconf" title="httpdconf: HTTPd Configuration"><tt class="xref py py-mod docutils literal"><span class="pre">httpdconf</span></tt></a> views it as -just a single string, e.g. <tt class="docutils literal"><span class="pre">CustomLog('logs/access_log</span> <span class="pre">combined')</span></tt>.</p> -</dd></dl> - -<dl class="class"> -<dt id="httpdconf.Container"> -<em class="property">class </em><tt class="descclassname">httpdconf.</tt><tt class="descname">Container</tt><big>(</big><em>*args</em><span class="optional">[</span>, <em>only_if=None</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#httpdconf.Container" title="Permalink to this definition">¶</a></dt> -<dd><p>A Container groups directives specified as <em>args</em> into a single -object. args can include other containers as well. The optional -<em>only_if</em> argument is a string of Python that is evaled at -directive render time. The directive is rendered only if the eval -return a true value.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">c</span> <span class="o">=</span> <span class="n">Container</span><span class="p">(</span><span class="n">CustomLog</span><span class="p">(</span><span class="s">'logs/access_log combined'</span><span class="p">),</span> <span class="n">ErrorLog</span><span class="p">(</span><span class="s">'logs/error_log'</span><span class="p">))</span> -<span class="gp">>>> </span><span class="k">print</span> <span class="n">c</span> -<span class="go">CustomLog logs/access_log combined</span> -<span class="go">ErrorLog logs/error_log</span> -</pre></div> -</div> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">print</span> <span class="sb">`c`</span> -<span class="go">Container(</span> -<span class="go"> CustomLog('logs/access_log combined'),</span> -<span class="go"> ErrorLog('logs/error_log'),</span> -<span class="go"> only_if='True')</span> -<span class="go">)</span> -</pre></div> -</div> -<p>Note how elements within a Container are properly indented when -rendered as Python code. A more practical example of only_if may be -<tt class="docutils literal"><span class="pre">only_if="mod_python.version.HTTPD_VERSION[0:3]</span> <span class="pre">==</span> <span class="pre">'2.4'"</span></tt>.</p> -<dl class="method"> -<dt id="httpdconf.Container.append"> -<tt class="descname">append</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#httpdconf.Container.append" title="Permalink to this definition">¶</a></dt> -<dd><p>Appends an object to a container. There is no difference -between specifying contained object at creation time or -appending elements to a container later.</p> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt> -<tt class="descname">ContainerTag(tag, attr, args[, flipslash=1)]</tt></dt> -<dd><p>A ContainerTag is a tag that contains other tags, -e.g. <tt class="docutils literal"><span class="pre">Directory</span></tt> or <tt class="docutils literal"><span class="pre">Location</span></tt>.</p> -</dd></dl> - -<dl class="class"> -<dt id="httpdconf.Comment"> -<em class="property">class </em><tt class="descclassname">httpdconf.</tt><tt class="descname">Comment</tt><big>(</big><em>comment</em><big>)</big><a class="headerlink" href="#httpdconf.Comment" title="Permalink to this definition">¶</a></dt> -<dd><p>A Comment renders itself as an Apache configuration comment. There -is no need to include <tt class="docutils literal"><span class="pre">#</span></tt> as part of the <em>comment</em> -string. Multi-line comments can be specified by a newline -charater. Example:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">c</span> <span class="o">=</span> <span class="n">Comment</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">This is</span><span class="se">\n</span><span class="s">a comment</span><span class="se">\n</span><span class="s">"</span><span class="p">)</span> -<span class="gp">>>> </span><span class="k">print</span> <span class="n">c</span> -<span class="go">#</span> -<span class="go"># This is</span> -<span class="go"># a comment</span> - -<span class="gp">>>> </span><span class="k">print</span> <span class="sb">`c`</span> -<span class="go">Comment('\n'</span> -<span class="go"> 'This is\n'</span> -<span class="go"> 'a comment\n')</span> -</pre></div> -</div> -</dd></dl> - -<p><a class="reference internal" href="#module-httpdconf" title="httpdconf: HTTPd Configuration"><tt class="xref py py-mod docutils literal"><span class="pre">httpdconf</span></tt></a> includes a basic set of Apache configuration -directives (see code for which ones), but any Apache configuration -directive can be trivially created by sub-classing one of the above -classes:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">mod_python.httpdconf</span> <span class="kn">import</span> <span class="o">*</span> -<span class="gp">>>> </span><span class="k">class</span> <span class="nc">MyDirective</span><span class="p">(</span><span class="n">Directive</span><span class="p">):</span> -<span class="gp">... </span> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">val</span><span class="p">):</span> -<span class="gp">... </span> <span class="n">Directive</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span> <span class="n">val</span><span class="p">)</span> -<span class="gp">...</span> -<span class="gp">>>> </span><span class="n">c</span> <span class="o">=</span> <span class="n">MyDirective</span><span class="p">(</span><span class="s">'foo'</span><span class="p">)</span> -<span class="gp">>>> </span><span class="k">print</span> <span class="n">c</span> -<span class="go">MyDirective foo</span> -</pre></div> -</div> -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Python API</a><ul> -<li><a class="reference internal" href="#multiple-interpreters">Multiple Interpreters</a></li> -<li><a class="reference internal" href="#overview-of-a-request-handler">Overview of a Request Handler</a></li> -<li><a class="reference internal" href="#overview-of-a-filter-handler">Overview of a Filter Handler</a></li> -<li><a class="reference internal" href="#overview-of-a-connection-handler">Overview of a Connection Handler</a></li> -<li><a class="reference internal" href="#module-apache"><tt class="docutils literal"><span class="pre">apache</span></tt> – Access to Apache Internals.</a><ul> -<li><a class="reference internal" href="#functions">Functions</a></li> -<li><a class="reference internal" href="#attributes">Attributes</a></li> -<li><a class="reference internal" href="#table-object-mp-table">Table Object (mp_table)</a></li> -<li><a class="reference internal" href="#request-object">Request Object</a><ul> -<li><a class="reference internal" href="#request-methods">Request Methods</a></li> -<li><a class="reference internal" href="#request-members">Request Members</a></li> -</ul> -</li> -<li><a class="reference internal" href="#connection-object-mp-conn">Connection Object (mp_conn)</a><ul> -<li><a class="reference internal" href="#connection-methods">Connection Methods</a></li> -<li><a class="reference internal" href="#connection-members">Connection Members</a></li> -</ul> -</li> -<li><a class="reference internal" href="#filter-object-mp-filter">Filter Object (mp_filter)</a><ul> -<li><a class="reference internal" href="#filter-methods">Filter Methods</a></li> -<li><a class="reference internal" href="#filter-members">Filter Members</a></li> -<li><a class="reference internal" href="#server-object-mp-server">Server Object (mp_server)</a></li> -<li><a class="reference internal" href="#server-methods">Server Methods</a></li> -<li><a class="reference internal" href="#server-members">Server Members</a></li> -</ul> -</li> -</ul> -</li> -<li><a class="reference internal" href="#module-util"><tt class="docutils literal"><span class="pre">util</span></tt> – Miscellaneous Utilities</a><ul> -<li><a class="reference internal" href="#fieldstorage-class">FieldStorage class</a><ul> -<li><a class="reference internal" href="#fieldstorage-methods"><tt class="docutils literal"><span class="pre">FieldStorage</span></tt> methods</a></li> -</ul> -</li> -<li><a class="reference internal" href="#fieldstorage-examples">FieldStorage Examples</a><ul> -<li><a class="reference internal" href="#simple-file-control-using-class-constructor">Simple file control using class constructor</a></li> -<li><a class="reference internal" href="#advanced-file-control-using-object-factory">Advanced file control using object factory</a></li> -</ul> -</li> -<li><a class="reference internal" href="#field-class">Field class</a></li> -<li><a class="reference internal" href="#other-functions">Other functions</a></li> -</ul> -</li> -<li><a class="reference internal" href="#module-Cookie"><tt class="docutils literal"><span class="pre">Cookie</span></tt> – HTTP State Management</a><ul> -<li><a class="reference internal" href="#classes">Classes</a><ul> -<li><a class="reference internal" href="#pyapi-cookie-func">Functions</a></li> -</ul> -</li> -<li><a class="reference internal" href="#examples">Examples</a></li> -</ul> -</li> -<li><a class="reference internal" href="#module-Session"><tt class="docutils literal"><span class="pre">Session</span></tt> – Session Management</a><ul> -<li><a class="reference internal" href="#pyapi-sess-classes">Classes</a></li> -<li><a class="reference internal" href="#pyapi-sess-example">Examples</a></li> -</ul> -</li> -<li><a class="reference internal" href="#module-psp"><tt class="docutils literal"><span class="pre">psp</span></tt> – Python Server Pager</a></li> -<li><a class="reference internal" href="#module-httpdconf"><tt class="docutils literal"><span class="pre">httpdconf</span></tt> – HTTPd Configuration</a><ul> -<li><a class="reference internal" href="#classes-for-directive-types">Classes for Directive types</a></li> -</ul> -</li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="tutorial.html" - title="previous chapter">Tutorial</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="directives.html" - title="next chapter">Apache Configuration Directives</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/pythonapi.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="directives.html" title="Apache Configuration Directives" - >next</a> |</li> - <li class="right" > - <a href="tutorial.html" title="Tutorial" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/search.html b/doc-html/search.html deleted file mode 100644 index 244e660243772585ed385140dffc1352af7f44f3..0000000000000000000000000000000000000000 --- a/doc-html/search.html +++ /dev/null @@ -1,106 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Search — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/searchtools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <script type="text/javascript"> - jQuery(function() { Search.loadIndex("searchindex.js"); }); - </script> - - - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <h1 id="search-documentation">Search</h1> - <div id="fallback" class="admonition warning"> - <script type="text/javascript">$('#fallback').hide();</script> - <p> - Please activate JavaScript to enable the search - functionality. - </p> - </div> - <p> - From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. - </p> - <form action="" method="get"> - <input type="text" name="q" value="" /> - <input type="submit" value="search" /> - <span id="search-progress" style="padding-left: 10px"></span> - </form> - - <div id="search-results"> - - </div> - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/searchindex.js b/doc-html/searchindex.js deleted file mode 100644 index b68a3fbe10eca2bb2c4e89c2388d93852b1e50b6..0000000000000000000000000000000000000000 --- a/doc-html/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({objects:{"":{"--pythonoption":[6,0,1],Session:[7,1,1],util:[7,1,1],"--pythonhandler":[6,0,1],Cookie:[7,1,1],httpdconf:[7,1,1],apache:[7,1,1],"--pythonpath":[6,0,1],psp:[7,1,1],"--listen":[6,0,1]},"Cookie.SignedCookie":{parse:[7,4,1]},"httpdconf.Container":{append:[7,4,1]},"Session.BaseSession":{load:[7,4,1],invalidate:[7,4,1],save:[7,4,1],created:[7,4,1],init_lock:[7,4,1],last_accessed:[7,4,1],is_new:[7,4,1],unlock:[7,4,1],cleanup:[7,4,1],timeout:[7,4,1],lock:[7,4,1],set_timeout:[7,4,1],id:[7,4,1],"delete":[7,4,1]},"apache.connection":{local_host:[7,2,1],client_ip:[7,2,1],keepalives:[7,2,1],double_reverse:[7,2,1],remote_addr:[7,2,1],read:[7,4,1],client_addr:[7,2,1],local_ip:[7,2,1],remote_logname:[7,2,1],id:[7,2,1],write:[7,4,1],log_error:[7,4,1],aborted:[7,2,1],base_server:[7,2,1],keepalive:[7,2,1],readline:[7,4,1],local_addr:[7,2,1],remote_host:[7,2,1],notes:[7,2,1],remote_ip:[7,2,1]},"Cookie.Cookie":{parse:[7,4,1]},"apache.server":{server_hostname:[7,2,1],get_options:[7,4,1],keep_alive:[7,2,1],names:[7,2,1],port:[7,2,1],wild_names:[7,2,1],server_admin:[7,2,1],is_virtual:[7,2,1],limit_req_fields:[7,2,1],log_error:[7,4,1],defn_line_number:[7,2,1],get_config:[7,4,1],defn_name:[7,2,1],limit_req_fieldsize:[7,2,1],error_fname:[7,2,1],path:[7,2,1],loglevel:[7,2,1],register_cleanup:[7,4,1],limit_req_line:[7,2,1],keep_alive_max:[7,2,1],timeout:[7,2,1],keep_alive_timeout:[7,2,1],pathlen:[7,2,1]},"util.FieldStorage":{list:[7,2,1]},httpdconf:{Comment:[7,3,1],Container:[7,3,1],Directive:[7,3,1]},"psp.PSPInterface":{redirect:[7,4,1],apply_data:[7,4,1],set_error_page:[7,4,1]},"apache.table":{add:[7,4,1]},util:{redirect:[7,5,1],getlist:[7,4,1],keys:[7,4,1],parse_qsl:[7,5,1],add_field:[7,4,1],parse_qs:[7,5,1],items:[7,4,1],clear:[7,4,1],get:[7,4,1],Field:[7,3,1],has_key:[7,4,1],FieldStorage:[7,3,1],getfirst:[7,4,1]},Session:{MemorySession:[7,3,1],Session:[7,5,1],FileSession:[7,3,1],BaseSession:[7,3,1],DbmSession:[7,3,1]},"apache.filte":{flush:[7,4,1]},"apache.filter":{name:[7,2,1],read:[7,4,1],handler:[7,2,1],req:[7,2,1],write:[7,4,1],is_input:[7,2,1],disable:[7,4,1],closed:[7,2,1],close:[7,4,1],readline:[7,4,1],pass_on:[7,4,1]},apache:{allow_methods:[7,5,1],stat:[7,5,1],import_module:[7,5,1],MODULE_MAGIC_NUMBER_MINOR:[7,2,1],exists_config:[7,5,1],register_cleanup:[7,5,1],server_root:[7,5,1],main_server:[7,2,1],make_table:[7,5,1],log_error:[7,5,1],table:[7,3,1],mpm_query:[7,5,1],interpreter:[7,2,1],MODULE_MAGIC_NUMBER_MAJOR:[7,2,1],config_tree:[7,5,1]},"apache.request":{protocol:[7,2,1],header_only:[7,2,1],interpreter:[7,2,1],unparsed_uri:[7,2,1],log_error:[7,4,1],main:[7,2,1],remaining:[7,2,1],allow_methods:[7,4,1],assbackwards:[7,2,1],read:[7,4,1],subprocess_env:[7,2,1],canonical_filename:[7,2,1],allowed_xmethods:[7,2,1],the_request:[7,2,1],notes:[7,2,1],content_languages:[7,2,1],server:[7,2,1],useragent_ip:[7,2,1],no_cache:[7,2,1],add_cgi_vars:[7,4,1],get_options:[7,4,1],status:[7,2,1],ap_auth_type:[7,2,1],status_line:[7,2,1],useragent_addr:[7,2,1],add_handler:[7,4,1],register_cleanup:[7,4,1],set_content_length:[7,4,1],set_etag:[7,4,1],filename:[7,2,1],mtime:[7,2,1],method:[7,2,1],register_output_filter:[7,4,1],eos_sent:[7,2,1],args:[7,2,1],construct_url:[7,4,1],chunked:[7,2,1],get_basic_auth_pw:[7,4,1],internal_redirect:[7,4,1],bytes_sent:[7,2,1],range:[7,2,1],add_common_vars:[7,4,1],discard_request_body:[7,4,1],err_headers_out:[7,2,1],user:[7,2,1],auth_type:[7,4,1],read_chunked:[7,2,1],read_body:[7,2,1],connection:[7,2,1],ssl_var_lookup:[7,4,1],proxyreq:[7,2,1],sent_bodyct:[7,2,1],update_mtime:[7,4,1],request_time:[7,2,1],next:[7,2,1],vlist_validator:[7,2,1],handler:[7,2,1],content_encoding:[7,2,1],prev:[7,2,1],expecting_100:[7,2,1],method_number:[7,2,1],content_type:[7,2,1],allowed_methods:[7,2,1],add_output_filter:[7,4,1],is_https:[7,4,1],auth_name:[7,4,1],register_input_filter:[7,4,1],meets_conditions:[7,4,1],finfo:[7,2,1],headers_out:[7,2,1],flush:[7,4,1],readlines:[7,4,1],allowed:[7,2,1],read_length:[7,2,1],hostname:[7,2,1],add_input_filter:[7,4,1],write:[7,4,1],no_local_copy:[7,2,1],set_last_modified:[7,4,1],clength:[7,2,1],headers_in:[7,2,1],document_root:[7,4,1],sendfile:[7,4,1],proto_num:[7,2,1],get_config:[7,4,1],path_info:[7,2,1],phase:[7,2,1],readline:[7,4,1],used_path_info:[7,2,1],uri:[7,2,1],parsed_uri:[7,2,1],get_remote_host:[7,4,1],requires:[7,4,1]},psp:{parse:[7,5,1],PSPInterface:[7,3,1],parsestring:[7,5,1]},"util.Field":{disposition_options:[7,2,1],file:[7,2,1],name:[7,2,1],value:[7,2,1],filename:[7,2,1],disposition:[7,2,1],type_options:[7,2,1],type:[7,2,1]},"psp.PSP":{display_code:[7,4,1],run:[7,4,1]},Cookie:{MarshalCookie:[7,3,1],get_cookies:[7,5,1],get_cookie:[7,5,1],Cookie:[7,3,1],SignedCookie:[7,3,1],add_cookie:[7,5,1]}},terms:{content_length:[7,11],prefix:11,dirnam:[],session_cookie_nam:8,unparsed_uri:7,skeleton:6,whose:[7,4],authorit:12,accur:7,pythonimport:[11,8,12],http_proxy_authentication_requir:7,under:[2,4,6,7,8,11],merchant:2,everi:[7,8,9,2,4],risk:2,"__mp_clone__":[],figr:[],upstream:7,allow_method:7,http_request_entity_too_larg:7,aplog_crit:7,upload:[7,11,4],factori:[7,12],set_etag:[7,11],ap_add_cgi_var:7,verif:7,initialis:11,sizehint:7,m_checkout:7,direct:[1,2,6,7,8,9,10,11,12],mydirect:7,second:7,nthi:7,m_mkactiv:7,even:[2,4,7,8,11,9],pythoninithandl:[8,12],somedirectori:7,entir:[7,10],neg:[7,8],asid:[1,4],litig:2,"new":[1,6,7,10,11,12],ever:[7,11],spamcooki:7,told:9,elimin:8,behavior:[7,8,4],never:[5,7,8,4],here:[7,1,9,4],gettempdir:7,debugg:8,path:[1,4,6,7,8,9,11,12],interpret:[11,7,8,12,2],get_opt:[11,7,8],forum:[],taper:7,http_temporary_redirect:7,anymor:7,errorlog:7,jame:2,bitmask:7,pspdbmcach:[7,8],permit:8,wdy:7,studi:1,portabl:2,a4ea:7,ap_auth_typ:[7,11],get_cooki:7,ssl_var_lookup:[7,11],"_footer":10,total:2,proxyreq_:7,highli:[7,1,9],describ:[2,4,6,7,11,9],would:[1,2,4,7,10,8,11,9],init:11,base_serv:7,call:[1,2,4,5,7,8,10,11,9],recommend:[1,2,4,6,7,8,9],type:[1,2,4,7,8,9,11,12],until:7,add_cgi_var:[7,11],relat:[6,7,2],notic:[9,2],warn:[11,6,7,1],ap_mpmq_max_spare_daemon:7,keep_al:7,herebi:2,must:[1,2,4,6,7,8,10,11,9],anydbm:7,join:[7,1],restor:[11,8],mutex_directori:[8,1,11],work:[1,2,4,7,10,8,11,9],introduc:10,root:[7,1,4],overrid:[11,7,8],give:[11,7,8,2],smtp:9,indic:[11,7,8,9,2],caution:7,want:[7,8,9,2,4],m_invalid:7,david:7,"1130794f":7,end:[1,2,4,7,8,9],turn:[7,11,2],how:[1,2,5,7,8,9,10,11,12],outputfilt:[7,8],numarrai:11,verifi:[7,8,9,4],negoti:7,config:[8,6,7,1,9],vlist_valid:7,updat:[7,11],subprocess_env:[11,7,10],type_opt:7,after:[11,7,8,9,4],superus:1,befor:[4,7,10,8,11,9],modest:8,m_label:7,access_log:7,law:2,demonstr:[7,9],attempt:[8,7,1,9,4],third:[11,2],local_ip:[7,11],register_output_fit:11,minim:[8,4],exclud:2,http_reset_cont:7,alias:[7,8],maintain:[11,7,1,4],environ:[1,4,7,10,8,11],incorpor:[11,2],enter:[8,9],exclus:2,get_remote_host:7,order:[8,7,1,9,4],origin:[7,11,2,4],feedback:9,diagnos:1,offici:7,govern:2,becaus:[1,2,4,5,6,7,8,9],http_moved_perman:7,privileg:1,incid:2,affect:[7,11],flexibl:[],vari:[1,9],cfgtree_walk:11,digest:11,fixuphandl:10,fit:[7,2],servlet:[],fix:[11,8,12],"__class__":7,"_global_lock":11,thingi:7,persist:[7,10],comprehens:12,last_access:7,easier:[11,2],"_server_rec":11,them:[8,7,1,11,4],thei:[4,6,7,10,8,11,9],fragment:7,promin:2,safe:[11,4],nlink:7,promis:2,uri_:7,unpickl:7,timeout:[7,11],each:[2,4,7,10,8,11,9],debug:[11,10,4],authnam:[7,11,9],went:9,remote_ip:[7,11],oblig:2,side:[4,7,10,8,11,12],mean:[11,7,8,2],serveralia:7,resum:7,contant:11,flock:[],useragent_ip:7,goe:7,pycobject:11,content:[2,4,6,7,10,8,11,9],dso:[11,1],mypackag:[7,8],lib64:11,mp_release_interpret:11,oftern:[],multilin:11,wherea:11,situat:9,free:2,renegoti:7,inod:7,fast_cleanup:7,md5:7,convent:[11,7,8],traceback:[11,7,8],filter:[10,7,8,11,12],isn:7,confus:7,semaphor:[],rang:[7,10],ap_log_rerror:7,render:[7,11,9],independ:4,thereof:[7,9,2],restrict:[7,8,9],hook:[],instruct:[8,9],alreadi:[11,6,7,1,9],messag:[7,11,9],wasn:11,agre:2,session_cleanup_time_limit:[7,8],top:[9,4],sometim:[7,9],necessarili:[7,2],too:[9,2],similarli:[7,4],listen:6,namespac:[7,8],tool:[2,6,7,8,11,12],travers:[11,12,4],incur:2,past:1,filesmatch:11,target:[8,1,11,9],keyword:[7,8,9,12],provid:[1,2,4,5,7,8,10,11,9],expr:10,tree:[7,11],project:[5,6,12,2],matter:[8,1,9],propul:[],minut:7,entail:7,close:[7,11],ran:[],mind:7,infring:2,"_content_type_set":7,seem:2,incompat:7,ssl_session_id:7,realm:4,irrevoc:2,latter:[7,11,9],thorough:[10,9],fname:7,transmit:9,simplifi:[7,11,9],shall:2,usernam:[11,8,9],object:[2,4,7,10,9,8,11,12],m_version_control:7,regular:11,mp_finfo:7,letter:[],phase:[4,5,7,8,11,9],tradit:5,simplic:2,don:[7,10,2,4],doc:[7,11],pythonconnectionhandl:[7,8,12],doe:[1,2,6,7,9,11,12],declar:9,wildcard:[7,11],pythonhandl:[1,4,6,7,8,9,11,12],dbhash:7,notion:[7,11],dot:[7,8],has_kei:7,saga:2,ssl_protocol:7,mp_conn:[7,12],syntax:[1,2,4,6,7,8,10,12],add_common_var:7,identifi:[7,1,2],"__data__":7,involv:[9,2,4],absolut:[7,8,9],acquir:[],pcapsul:11,menu:[7,10],explain:[],configur:[1,2,4,6,7,8,9,10,11,12],apach:[1,2,3,4,5,6,7,8,9,10,11,12],http_no_cont:7,http_range_not_satisfi:7,stop:[4,6,7,12,11,9],compli:2,report:[11,1,9],mp_sess:7,bar:4,emb:[11,2],ietf:7,method:[4,7,10,12,11,9],reload:[11,7,8,4],bad:11,"__mp_purge__":[],respond:7,useragent_addr:[7,11],bitvector:7,result:[2,4,5,7,10,8,11,9],respons:[11,7,10,9,2],fail:[8,7,1],hash:7,best:[7,1],subject:[1,9,2],awar:7,said:9,databas:[8,2],sendfil:[7,11],figur:[8,7,1],outstand:2,http_ok:7,approach:[],attribut:[2,4,7,10,11,12],inabl:2,py_newinterpret:7,containertag:7,extend:[5,7],ap_mpmq_hard_limit_daemon:7,extens:[2,4,7,10,8,11],display_cod:7,workaround:11,extent:9,protect:[7,10,9,4],m_unlock:7,expos:11,howev:[8,7,1,11,2],against:[11,10,2,4],server_root:[6,7],http_not_extend:7,logic:[7,10],login:[7,9],com:[7,4],col:9,http_partial_cont:7,asctim:10,restructuredtext:[0,11],foobar:[7,1],cgihandl:[5,4],brigad:11,no_local_copi:[7,11],guid:[9,12],assum:[7,8,2,4],duplic:[7,10],liabil:2,union:2,connectionhandl:[7,8],three:[7,11,9,4],been:[11,7,8,9,2],much:[7,11,9,2],interest:2,basic:[7,1,9],interpreter_nam:8,request_rec:[7,11],life:7,deeper:[],worker:7,ani:[1,2,4,6,7,8,10,11,9],multithread:[11,10],child:[11,7,8],"catch":7,http_unauthor:[7,8,9,4],ident:7,reenabl:11,servic:[7,2],properti:7,commerci:2,aim:12,weren:[11,2],publicli:2,session_grace_period:8,document:[0,1,2,3,4,5,7,8,10,11,12],spawn:8,deliv:7,already_delet:7,kwarg:4,conf:[8,6,7,1],module_nam:7,conn:[7,11,9],incorrectli:7,perform:[1,2,4,5,7,8,9,10,11,12],suggest:7,make:[1,2,7,8,9,11,12],drawback:[],split:4,basesess:[7,11],complet:[11,7,8,9,3],hand:[7,1],fairli:[7,9],rais:[7,11,9],ownership:2,filesess:[7,11],kept:7,serverroot:[6,7,1],thu:[7,9,4],inherit:[7,11],"__auth_realm__":[11,4],client:[11,7,8,9,4],shortli:9,wherebi:11,thi:[1,2,3,4,5,6,7,8,9,10,11,12],endif:10,programm:10,everyth:[1,9],left:[11,7,8,9,4],protocol:7,just:[10,8,7,1],file_modification_tim:7,nowadai:[],yet:[7,8],languag:[7,8,12,2],previous:[7,11],easi:2,session_typ:[7,8],interfer:7,had:[7,11],keep_blank_valu:7,friedrich:7,primit:7,els:[10,7,8,9,4],save:[11,7,8,4],hat:5,gave:2,testhandl:[11,1],applic:[1,2,4,6,7,8,11,9],measur:8,preserv:[],disposit:7,hostnamelookup:7,fusion:2,background:1,elabor:2,authorship:2,remote_lognam:7,mptest:1,daemon:7,ap_hook_map_to_storag:8,ctime:7,specif:[0,1,2,4,7,8,11,9],arbitrari:[7,10],client_addr:7,manual:[7,1,9],authenhandl:[8,9],http_precondition_fail:7,unnecessari:8,underli:[7,11],www:[7,2,4],right:[10,8,2,4],old:11,deal:[7,9],interv:7,excerpt:2,born:2,intern:[11,7,8,12],set_content_length:7,dear:9,interf:11,successfulli:8,http_accept:7,insensit:7,forcibl:7,aplog_debug:7,subclass:7,track:[7,2],setoutputfilt:7,overcom:4,condit:[11,7,10,12,2],foo:[7,4],fieldstorag:[7,11,12,4],localhost:[11,1,9],peek:7,plu:[11,2],who:9,mpm_queri:7,sunsit:[],post:[7,11,9,4],"super":7,chapter:[1,2],sometempdir:7,surround:[7,10,4],unfortun:[7,8],canonic:[7,11],span:[7,11],http_creat:7,marshal:[7,11],ap_add_common_var:7,splitext:7,encod:[7,9,4],map_to_storag:11,down:[7,1],ssl_client_verifi:7,formerli:4,netscap:[7,2],"__access__":[11,4],opportun:8,storag:[7,4],wai:[1,4,5,7,8,11,9],frustrat:2,support:[2,4,5,7,10,11],transform:2,why:4,avail:[1,2,4,7,10,11,9],gif:8,reli:[7,8],request_method:7,editor:11,overhead:2,gil:[7,11],fork:7,head:7,medium:2,form:[2,4,6,7,8,9,10,11,12],offer:2,altogeth:7,"true":[7,10,2,4],reset:7,attr:7,maximum:[11,7,1],reiter:[],absenc:7,ap_log_error:7,autoconf:1,featur:[5,11,7,8,12],alongsid:2,update_mtim:[7,11],moved_temporarili:7,m_report:7,drive:[],exist:[1,4,6,7,10,8,11,9],ship:[],check:[1,4,5,7,8,11,9],assembl:2,server_error:9,finfo_:7,encrypt:[7,8,2],content_encod:7,module_magic_number_minor:7,when:[1,4,6,7,10,8,11,9],module2:[],module1:[],http_not_modifi:7,test:[1,4,5,7,10,11,12],maxrequestsperchild:4,is_http:[7,11],intend:[7,8,4],benefici:2,notwithstand:2,intens:7,intent:10,consid:[7,8,9],http_method_not_allow:7,receiv:[7,11,2],longer:[7,11],furthermor:7,htdoc:[7,1],pseudo:[],directoryindex:11,pathnam:[],time:[1,2,4,7,10,8,11],push:10,backward:[7,11],application_domain:[7,8],http_request_uri_too_larg:7,concept:2,chain:7,skip:[11,8,4],global:[10,7,8,11,12],focus:5,signific:[7,2],header_onli:7,customari:2,computation:[],row:9,decid:7,hold:[7,2],depend:[11,7,8,9],zpublish:[11,4],decim:7,readabl:[7,2],decis:[7,8],editori:2,sourc:[0,1,2,4,7,10,12],string:[4,6,7,10,11,9],word:[1,5,7,8,10,9],ip_address:6,field_callback:7,level:[11,7,10,4],did:[9,2],item:[7,11],quick:[9,12],setup:11,dir:[11,7,1,4],cetera:8,prevent:[1,9],slower:7,core:[7,4],sign:[7,11],ssi_glob:10,"0ab19e684268":7,port:[6,7,11,2],appear:[1,2,4,7,10,11],http_version_not_support:7,uniform:7,current:[4,5,7,10,8,11],deriv:[7,11,2],honour:10,gener:[0,1,2,4,6,7,10,11,9],disclaim:2,add_field:7,explicitli:[2,7,10,8,11,9],modif:[11,7,8,2],serveradmin:7,address:[6,7,11,9],m_proppatch:7,along:[7,11,2],ap_send_fd:11,wait:7,box:[8,9,4],m_put:7,mysit:[7,4],brilliant:2,worldwid:2,behav:[7,11],overriden:[],pythonloghandl:[8,12],commonli:[11,9],ipc:[],semant:7,regardless:[],extra:[],pentium:5,modul:[1,4,5,7,8,10,11,9],prefer:[7,10,2,4],leav:4,ahlstrom:2,fake:7,instal:[11,6,1,9,12],http_:7,httpd:[1,4,6,7,8,12],ap_mpmq_is_thread:7,memori:[7,11,2,4],visit:1,perl:2,live:7,handler:[1,4,5,6,7,8,9,10,11,12],value2:[],value1:[],msg:9,scope:[11,7,10,12],prev:[7,11],unsaf:11,capit:7,peopl:7,ap_mpmq_max_spare_thread:7,verify_cleanup:7,no_cach:[7,11],clue:1,appendix:2,templat:7,examin:[8,7,1,9],content_typ:[8,7,1,9],fly:4,prepar:2,pretend:9,battl:11,focu:4,descriptor:11,whatev:[7,11],purpos:[11,7,10,2],boilerpl:2,claim:[7,2],add_output_filt:[11,7,10],stream:[7,11],requ:[],backslash:[11,9],agent:7,abort:[11,6,7,8],simul:[],occur:[11,7,8],alwai:[1,4,6,7,11,9],multipl:[6,7,10,8,11,12],m_merg:7,write:[1,2,4,5,7,8,10,11,9],global_mutex:7,pure:7,limit_req_field:7,map:[5,10,7,8,4],product:[7,8,2,4],disposition_opt:7,max:[11,7,1],spot:7,make_t:[7,11],usabl:[7,12],mac:11,mai:[1,2,7,10,8,11,9],underscor:4,data:[4,7,10,12,11,9],goal:5,practic:7,stdin:4,explicit:[8,4],session_verify_cleanup:8,inform:[1,2,3,4,5,6,7,8,9,10,11,12],"switch":7,preced:[11,4],combin:[7,11,2],finfo_us:7,callabl:[11,7,8,4],pyerr_print:11,mpinfo:1,cold:2,still:[11,10,9,4],pointer:7,dynam:[10,7,8,11],entiti:[11,2],aplog_warn:7,conjunct:[11,10],runcal:8,group:[7,11],thank:9,polici:8,platform:[7,11,2],window:[7,9,2],add_common_car:[],mail:[1,9,2],main:[1,5,7,8,11,9],non:[2,4,7,10,11,9],dispens:[],supersed:2,initi:[11,6,7,8,2],therebi:[7,11,4],httpdconf:[6,7,11,12],now:[1,7,10,12,11,9],discuss:[7,2],nor:[7,11,4],introduct:[5,12,4],pychart:11,term:[2,4],name:[1,2,4,6,7,8,11,9],apply_data:7,didn:[11,1],revert:11,separ:[6,7,8,2,4],path_transl:7,ap_mpmq_dynam:7,januari:2,polit:7,compil:[1,2,5,6,7,10,11,12],"__mp_path__":[],domain:[7,11],dbmfile:7,replac:[2,4,7,10,8,11],individu:[7,2],continu:[7,11,2],contributor:2,redistribut:2,current_tim:7,year:2,happen:[11,7,8,9,2],file_factori:7,shown:[7,11],register_input_filt:[7,11],space:5,urlencod:7,internet:2,correct:[6,7,11,9],earlier:11,migrat:4,argv:11,request_tim:7,mime:11,theori:2,org:[7,1,2],"byte":[7,11],care:[6,7,1],reflect:[11,7,10],suffici:[7,10],pythoninputfilt:[7,8,12],wrong:[11,1],thing:[7,1,9,2],place:[1,2,4,7,10,8,11],pythoninterpperdirect:[11,7,8,12],imposs:7,getfirst:7,first:[1,2,4,6,7,8,10,11,9],oper:[8,7,1],reimplement:11,directli:[11,7,10,9,4],carri:[10,2],onc:[4,6,7,8,11,9],m_trace:7,yourself:1,acquisit:7,fast:7,oppos:[7,8],open:[7,9],size:[7,11,2],given:[7,1,9,4],breviti:7,ap_mpmq_max_daemon:7,nsapi:2,associ:[2,4,7,8,11,9],caught:2,session_fast_cleanup:8,limit_req_fields:7,cumul:8,draft:[],tell:[7,8,9],inst_test:[],white:7,conveni:7,server_hostnam:7,especi:[7,8],copi:[7,1,2],specifi:[1,4,6,7,8,11,9],enclos:[7,11,2],than:[11,7,8,9,2],temporaryfil:7,serv:[10,7,8,4],wide:[],m_mkworkspac:7,posix:[7,11],were:[7,11,9],http_non_authorit:7,browser:[10,8,7,1,9],pre:[10,7,1,12],sai:[7,9,4],argument:[4,6,7,8,9,11,12],alleg:2,pythonoutputfilt:[7,8,12],documentroot:[7,8,4],is_virtu:7,sat:7,shtml:10,techniqu:[7,4],recompil:10,destroi:[7,8],note:[1,4,7,10,8,11,9],forc:[11,7,8,4],ideal:1,take:[1,2,4,6,7,8,11,9],advis:[7,2],the_request:7,noth:[11,9,2,4],begin:[1,4,5,7,8,9],sure:[8,7,1,9],normal:[10,7,8,11,2],buffer:[7,11],pathlen:7,sublicens:2,pair:[7,8],http_upgrade_requir:11,pager:[5,7,1,12,4],textarea:9,later:[8,7,1,9,2],flipslash:7,enable_fast_cleanup:[7,8],hmac:7,recipi:2,show:[7,8,4],read_chunk:7,montypython:9,concurr:5,permiss:[3,2],bytes_s:7,fifti:2,onli:[1,2,4,5,6,7,8,9,10,11,12],slow:[8,2],activ:[7,8],written:[0,1,2,5,7,10,9],http_bad_request:7,dict:7,analyz:1,over:[5,7,1],overwritten:11,nearli:[7,2],variou:[8,7,1,11],get:[1,4,7,10,8,11,9],repr:[11,10],secondari:[],ssl:[7,11],cannot:[1,2,4,7,10,11],ssi:[11,10,12],exists_config_defin:[7,11],utf:7,ap_mpmq_not_support:7,requir:[1,2,4,6,7,8,11,9],truli:[2,4],reveal:8,apr_dir:7,borrow:8,yield:[7,9],irrespect:[],pythonautoreload:[11,8,12],where:[1,2,6,7,10,8,11,9],filenq:[],proce:9,rfc1413:[],cache_database_filenam:[7,8],concern:7,infinit:[7,11],charat:7,review:[],enough:[7,9],between:[4,7,10,8,11,9],"import":[1,2,4,5,7,8,10,11,9],subrequest:7,across:7,parent:[7,11],popul:[11,10,12],spare:7,come:[11,9],defn_nam:7,pertain:2,http_use_proxi:7,contract:2,inconsist:11,mani:[2,4,7,10,8,11],err_headers_out:7,undocu:7,color:7,overview:[6,7,10,12,8,9],inspir:[7,2,4],period:7,pop:9,colon:[6,7],m_baseline_control:7,typic:[5,7,1,9,4],poll:5,damag:2,better:[7,11,2],sess:7,clarif:11,harmless:2,myserv:9,mark:2,"_conn_rec":11,valueerror:[7,11],grace_period:7,indirect:2,resolut:[8,2],is_new:7,meets_condit:[7,11],http_insufficient_storag:7,spirit:2,standard:[1,4,5,7,9,11,12],"case":[1,4,7,10,8,11,9],trick:9,invok:[7,8],invoc:[12,4],content_languag:[7,11],advantag:[5,7,2,4],stdout:4,http_multiple_choic:7,destin:4,unit:11,myapp:6,"__init__":7,develop:[1,2,4,5,7,8,9],author:[7,2,4],read_length:7,media:2,script_filenam:11,same:[1,2,4,7,8,11,9],binari:[7,1],epoch:7,tutori:[10,1,9,12],pai:[],eventu:7,document_root:7,exhaust:7,nest:11,capabl:[7,2],widespread:11,improv:[7,11,12,2,4],extern:10,tradition:[5,10],libexec:1,appropri:[1,2,7,8,11,9],choos:2,without:[7,10,9,2],pythonopt:[1,4,6,7,8,11,12],execut:[2,4,6,7,10,8,11,9],excel:7,aspect:8,speed:2,miscellan:[7,12],hint:[11,1],except:[2,4,7,8,11,9],littl:[9,2],identif:[8,2],mod_perl:[8,2],exercis:[7,2],earli:[7,8],around:[7,8,9,2,4],acceptpathinfo:11,read:[4,5,7,8,11,9],swig:11,dispatch:9,world:[7,1,9,4],psp:[1,4,5,7,8,11,12],mod:[9,12],http_payment_requir:7,integ:7,server:[1,2,4,5,6,7,8,9,10,11,12],benefit:[7,2,4],either:[10,7,8,9,2],output:[1,4,5,6,7,8,10,11,9],manag:[2,5,6,7,8,11,12],yyyi:[7,2],deduct:7,verbal:2,wsgiapp:4,parse_q:7,http_conf:6,m_checkin:7,stringio:7,definit:[7,10,2,4],smtp_server:9,legal:2,src_string:11,exit:11,notabl:[],http_unprocessable_ent:7,refer:[1,4,7,8,9,11,12],power:[9,2],http_failed_depend:7,stringfield:7,ultim:7,broken:7,found:[1,2,4,7,8,11,9],construct_url:[7,11],"__name__":7,referr:4,"throw":7,src:[11,1],stone:4,patent:2,greatli:9,gregori:3,set_error_pag:7,addition:7,act:[7,1,9,2],backup:11,processor:0,routin:8,effici:[7,11,2],lastli:1,storagefactori:7,surviv:7,http_variant_also_vari:7,auth_nam:[7,11],your:[1,2,4,7,8,9,12],complianc:[7,2],area:9,aren:[],overwrit:6,start:[1,2,6,7,8,9,10,11,12],compliant:7,interfac:[5,7,11,9,2],low:[7,11],lot:4,ipv6:11,submiss:2,config_tre:7,machin:5,client_ip:[7,11],server_return:[7,11],tupl:[7,11],regard:[11,2],jun:7,amongst:10,buggi:2,faster:[7,11],notat:[7,8,9],hostinfo:7,possibl:[2,4,7,8,11,9],"default":[1,4,7,8,11,9],bucket:[7,11],unusu:1,pythonhandlermodul:[11,8,12],embed:[5,7,2],set_timeout:7,install_dso:[11,1],expect:[11,9,4],gone:9,creat:[1,4,6,7,8,9,10,11,12],filt:7,certain:7,m_uncheckout:7,file:[1,2,4,6,7,8,9,10,11,12],contributori:2,fill:7,incorrect:[11,7,1],again:[11,8,4],pythoninterpperdirectori:[11,7,8,12],prepend:[7,8,9],field:[2,4,7,8,12,9],valid:[11,7,8,9],writabl:[11,7,1],ignor:[10,8,7,1,11],you:[1,2,4,6,7,8,10,9],trubetskoi:3,serverpath:7,architectur:11,sequenc:[11,7,8,9],symbol:7,allowoverrid:1,indemnifi:2,reduc:7,assert:2,reimport:8,used_path_info:[7,11],unload:[],directori:[1,4,6,7,8,11,9],descript:[5,7,10,2],potenti:[7,11],escap:[11,10],licensor:2,cpu:7,unset:11,represent:[7,11,4],all:[1,2,4,5,6,7,8,9,11,12],consider:8,abil:[7,10],follow:[1,2,4,6,7,8,10,11,9],gdbm:7,disk:[7,11,4],aplog_err:7,script_nam:[11,4],aaron:2,program:[1,2,4,7,10,8,9],those:[11,7,8,9,2],neglig:2,norm:[],consum:[7,8],fals:[7,11,4],mpm:[11,7,10],util:[7,11,12],candid:7,mechan:[1,2,4,7,10,11],fall:[5,8,9],veri:[1,2,4,5,7,8,9],condition:7,addinputfilt:8,webmast:9,list:[1,2,4,6,7,8,11],emul:4,adjust:[6,4],small:[7,8],status_lin:[7,11],cobject:11,pythonenablepdb:[11,8,12],http_see_oth:7,allowed_xmethod:[7,11],direc:8,zero:[7,10,4],pressur:2,design:[11,2],pass:[11,7,8,9,4],further:[7,8],excit:2,what:[1,2,4,7,8,9,11,12],sub:[6,7,11,12],session_dbm:[7,8],section:[1,2,4,7,8,11,9],advanc:[7,12],abl:[6,11,4],overload:7,delet:[7,11,4],version:[1,2,4,6,7,10,9,11,12],localtim:10,"public":11,essenc:4,hasn:11,full:[7,8,4],themselv:[11,2],authtyp:[7,11,9],behaviour:[11,7,8],solari:2,inher:4,strong:7,modifi:[7,11,2],valu:[4,7,10,8,11,9],search:[11,8],ahead:9,python_modul:1,pagebuff:9,prior:[10,7,8,11,4],amount:7,action:[8,9],http_unsupported_media_typ:7,myscrip:4,via:[4,5,7,10,8,9],declin:[11,7,8],intermedi:[],transit:[],base_url:[],deprec:[11,7,8],send:[11,7,1,9],suse:11,mem_cleanup:11,select:[7,1],distinct:[11,7,10],regist:[11,7,8,9],two:[10,7,8,9,4],coverag:5,pythonauthzhandl:[11,8,12],file_sess:[7,8],taken:[7,8,9],minor:7,more:[1,2,4,7,8,9,10,11,12],kristol:7,desir:[11,1],memorysess:[7,11],flag:7,proxyreq_respons:11,broke:11,particular:[1,2,4,7,10,8,9],known:[7,8],cach:[11,7,10],dictat:[7,8],none:[11,7,8,4],assbackward:7,counterclaim:2,valuabl:[],http_bad_gatewai:7,dev:1,histori:[3,2,12],remain:[7,11,2,4],paragraph:7,del:7,learn:2,def:[1,4,7,10,8,9],checkallow:8,request_data:7,discard_request_bodi:[7,11],prompt:8,cherrypi:11,challeng:2,registr:[11,7,8],share:[7,2],accept:[11,7,8,9,2],minimum:7,newlin:7,secur:[11,7,8,12,4],rather:[5,11,7,8],anoth:[10,7,8],reject:7,apr_stat:11,simpl:[6,7,9,12,4],http_conflict:7,resourc:[8,7,1,11],referenc:7,our:[7,9],variant:7,"long":[7,11,2,4],filesession_cleanup:7,my_appl:4,pythontypehandl:[11,8,12],http_moved_temporarili:7,canonical_filenam:[7,11],circumst:7,"short":7,footer:10,register:7,cookie_nam:8,caus:[1,2,4,7,8,11,9],callback:11,egg:[7,8,9,4],help:1,max_ag:7,soon:[11,8,2],trade:2,paper:5,through:[2,7,10,8,11,9],pane:10,hierarchi:11,paramet:[11,7,1,9],style:[7,11,4],exact:[7,9],segfault:11,html:[2,4,5,7,10,11,9],m_propfind:7,might:[7,8],alter:7,wouldn:11,good:[7,4],"return":[1,4,7,10,8,11,9],food:[],pollut:8,var_nam:7,mod_mim:7,framework:[7,11,4],complain:11,bigger:2,uri_path:7,samp:[],troubleshoot:[1,12],unlik:[7,8],authent:[2,4,7,8,9,11,12],pythonoptim:[8,12],easili:[10,8],achiev:7,http_service_unavail:7,fulli:[7,11],unicod:7,only_if:[7,11],hard:7,idea:[6,7,8,2],realli:[11,2],connect:[11,7,8,12,2],event:[10,9,2],main_interpret:[7,11],publish:[4,5,7,12,11,9],research:2,etag:7,print:[6,7,10,2],freeze_modul:[],qualifi:[11,7,8],asp:[7,2],proxi:[7,11],pythonauthenhandl:[4,7,8,12,11,9],guess:7,cooki:[5,7,11,12],reason:[8,1,11,2,4],base:[2,4,5,6,7,8,11,9],ask:[1,9],bash:11,basi:2,thread:[7,11,4],launch:7,exists_config:7,omit:[7,8],pspinterfac:7,perman:7,lifetim:[6,10],assign:[11,7,8,9,4],major:7,obviou:9,upper:7,libpython:1,number:[5,8,7,1,11],psp_:4,done:[1,2,4,5,7,8,10,11,9],least:[7,1,9,2],blank:[7,4],mistakenli:7,miss:[7,11,9],differ:[11,7,8,9,2],http_switching_protocol:7,posixpath:7,script:[1,4,5,6,7,8,11,9],interact:8,reentrant:1,statement:[10,2],scheme:[7,11],store:[7,10,4],adher:11,option:[1,4,6,7,10,8,11],relationship:4,real_filenam:7,str_is_ip:7,part:[1,2,4,5,7,8,10,11,9],pars:[5,7,8],somehost:4,error_fnam:7,grace:[6,11],kind:[5,7,9,2],contrari:[],whenev:11,remot:[7,11,4],remov:[11,7,8,9,4],setinputfilt:7,inputfilt:8,pythoninterpret:[7,8,12],reus:7,str:[7,10,4],"_apach":[7,11],comput:[7,2,4],subinterpret:[7,8],beforehand:7,packag:[8,7,1,11,9],expir:7,"null":11,sell:2,imagin:[7,2],unintend:8,built:7,equival:[7,11],remote_addr:[7,11],self:7,"_lock":[],mycooki:7,silent:4,sethandl:[11,7,1,4],exec:10,passwd:4,"_request_rec":11,previou:[7,8],reach:7,most:[1,2,4,5,7,8,10,11,9],jsp:7,path_info:[7,11,4],maco:11,charg:2,addr:11,clear:[7,11,4],cover:7,ext:8,"_escap":10,clean:[11,7,8],latest:[7,11],microsoft:11,visibl:[10,1],wsgi:[11,6,8,12,4],carefulli:1,session:[1,5,7,8,11,12],done_process:8,fine:9,find:[7,1,4],impact:8,pretti:2,solut:[7,2],local_addr:[7,11],pythonaccesshandl:[8,12],smtplib:9,hit:[7,8,2],transhandl:8,"__file__":4,express:[11,7,10,12,2],setenvif:10,interpet:7,nativ:9,liabl:2,restart:[1,6,7,8,11,12],rfc:[7,4],ap_mpmq_stat:7,common:[7,10,2],pythoncleanuphandl:[11,8,12],remote_double_rev:7,set:[1,2,4,7,10,8,11,9],database_filenam:[7,8],see:[1,2,3,4,5,7,8,9,10,11,12],sec:7,arg:[7,11],reserv:[8,1,12],analog:7,marshacooki:7,someth:[1,4,7,8,9,11,12],won:7,mutex:[11,7,1],subdir:9,subscript:7,altern:[8,7,1,4],signatur:7,syntact:6,eos_sent:7,sole:2,incident:2,succeed:[7,8],distinguish:[],filter_nam:7,ap_mpmq_is_fork:7,struct:11,both:[1,2,4,7,8,11],last:[11,7,8,4],delimit:4,alon:2,alow:6,context:[11,7,8],whole:[7,8,2,4],pdb:[11,8],load:[1,2,4,7,8,11,9],simpli:[1,4,6,7,8,11],point:[11,7,1,9,4],instanti:[7,8,4],remote_nam:7,header:[5,7,10,8,11,9],shutdown:[7,11],linux:[5,11],throughout:7,dfoobar:7,mp_tabl:[7,12],stamp:8,mywebdir:9,devic:7,due:11,perpetu:2,whom:2,secret:7,strategi:7,minial:[],wish:[7,1,9],pythonpostreadrequesthandl:[8,12],consequenti:2,is_input:[7,11],understand:9,func:7,tangenti:4,convers:2,remote_us:7,look:[8,7,1,9,4],"while":[10,7,8,2,4],unifi:11,smart:[7,9],abov:[1,2,4,6,7,9],http_continu:7,robin:7,loop:7,htmlgen:7,real:7,ap_mpmq_min_spare_daemon:7,readm:[11,2],herein:2,revers:7,itself:[1,2,6,7,10,11],rid:11,addhandl:[7,1,9,4],guido:2,grant:2,remote_id:7,wherein:4,decod:[7,8,9],zope:4,conflict:11,higher:1,x86:11,goodwil:2,optim:[11,7,8],leopard:11,m_mkcol:7,moment:1,temporari:7,user:[2,4,7,8,9,11,12],robust:[],wherev:2,stack:[7,11,9],recent:11,lower:[11,7,8,9],task:[6,8,9,2],pythondebug:[1,4,10,9,8,11,12],lib:8,discourag:7,older:[7,11],entri:7,grossli:2,file_callback:7,expens:[7,8],mon:7,explan:9,construct:[11,7,10,9,4],morsel:7,fflush:11,"_handler":10,cut:1,signal:[7,11],also:[1,2,4,5,7,8,9,11,12],is_loc:11,http_gone:7,shortcut:[],input:[11,7,8,9,4],subsequ:[11,7,8,9,2],parsestr:[7,11],build:[11,6,1],bin:1,complaint:11,obsolet:7,format:[11,7,10,2],m_get:7,gatewai:[],verify_session_timeout:[7,8],m_lock:7,insert:[7,10],bit:[11,8,9],"__auth__":[11,4],semi:11,rossum:2,http_process:7,resolv:[11,8],httponli:[7,11],add_handl:[11,7,8],collect:9,"boolean":7,test_condit:10,popular:[7,2],admittedli:8,specfici:9,aplog_noerrno:[7,11],autoreload:[11,7,8],encount:[7,8,4],often:[7,8,4],method_not_allow:7,some:[1,2,4,7,10,8,11,9],back:[9,10,8,11,2],emph:[],unspecifi:7,distribut:[1,2],mod_auth:[11,4],method_numb:7,though:[7,11,9,4],pep:[7,11,4],per:[6,7,4],set_last_modifi:[7,11],substitut:[10,1,9,4],larg:[7,11,4],slash:[11,9,4],reproduc:2,cgi:[2,4,5,7,10,12],constru:2,run:[1,4,5,6,7,8,9,11,12],zzz:[],agreement:2,aplog_notic:7,"2ghz":5,step:[8,9,4],hlist:11,prerequisit:[1,12],impos:7,faith:2,get_basic_auth_pw:[7,8,9],internal_redirect:[7,11],import_modul:[11,7,8],"_apachemodul":11,dialog:[8,9,4],pertin:11,exc_info:7,block:[7,10,4],local_host:[7,11],"__repr__":7,primarili:7,pythonpath:[4,6,7,8,11,12],within:[2,4,7,10,8,11,9],bsd:7,new_uri:7,ensur:[7,11],unmarshal:7,defn_line_numb:7,occupi:7,inclus:2,institut:2,spam:[7,8,9,4],megabyt:2,submit:[7,9,2,4],custom:[7,1,9],adjac:7,includ:[1,2,6,7,8,10,11,12],suit:11,forward:9,expecting_100:7,properli:[7,11,4],includesnoexec:10,link:[8,2],translat:[7,8,9,2],line:[1,4,6,7,8,9,10,11,12],info:7,concaten:7,httpdapi:[11,2],consist:[6,7,9,2],applicationpath:[7,8],caller:11,typehandl:7,unlock:[7,11],ap_mpmq_max_thread:7,readlin:[7,11],similar:[7,11],constant:[7,11,4],parser:[5,7,1],doesn:[11,7,8,9],repres:[7,2],curl:11,fixup:[11,10],titl:2,sequenti:8,invalid:[7,11],bracket:[7,2],nice:[7,4],pythonheaderparserhandl:[8,12],wrongli:11,eval:[10,7,8],lent:2,mymodul:[7,8],algorithm:[12,4],httpd_conf:6,virtualhost:[7,11],depth:7,riectiv:[],came:[7,2],far:[7,1,4],hello:[1,4,5,7,10,9],prototyp:11,code:[1,2,4,7,8,9,10,11,12],queri:[7,4],cogniz:[],privat:11,sensit:[8,4],base64:9,database_directori:[7,8],conspicu:2,behalf:2,aris:[7,2],fatal:7,sent:[7,8,9,2,4],random:7,ap_log_cerror:[7,11],electron:2,implicitli:1,relev:1,tri:8,magic:11,complic:[8,9,12],button:9,"try":[8,7,1,9],race:[7,11],base_uri:[8,4],authbasicauthorit:9,pleas:[1,9],impli:[7,2],cap:8,cleanup_time_limit:[7,8],"_header":10,cleanup_grace_period:[7,8],config_dir:11,click:9,append:[7,8,4],aplog_alert:7,compat:[6,7,11],index:[7,11,4],secret007:7,compar:[10,7,8,9,4],authauthorit:9,http_error:7,access:[4,5,7,10,9,8,11,12],ap_meets_condit:7,experiment:11,can:[1,2,4,6,7,8,10,11,9],http_forbidden:[7,8,9,4],len:[7,10,4],bodi:[11,7,10],let:[10,9,4],ioerror:[7,8],becom:[4,6,7,8,11,9],sinc:[7,8,9,4],obsolesc:7,great:[7,9],produc:[6,7,9],copyright:[11,3,2,12],technolog:10,defeat:4,chang:[1,2,4,7,8,9,10,11,12],problemat:9,chanc:[7,8],m_post:7,apx:1,response_head:4,apr:[11,7,1],appli:[11,6,7,10,2],app:[6,4],foundat:3,submodul:[],constitut:[10,2],proxyreq:[7,11],api:[5,7,11,9,12],genconfig:[6,12],uniqu:7,install_py_lib:1,numer:7,rfc2109:7,fee:2,from:[0,1,2,4,6,7,8,9,10,11,12],commun:[7,11,9,2],doubl:7,mydir:8,next:[11,7,1,9,4],implic:[7,4],few:[7,1,9,2],usr:[8,1],postreadrequesthandl:8,remaind:4,sort:10,http_request_time_out:7,pymember_get:11,comparison:10,mismatch:[11,4],py_fin:11,trail:[11,4],rare:[7,9],iii:2,reproduct:2,m_connect:7,retriev:[7,8],m_patch:7,augment:8,alia:[7,8],annot:2,meet:2,finfo:[7,11],control:[7,12,2,4],mp_filter:[7,12],process:[1,2,4,5,7,8,10,11,9],lock:[11,7,1,4],advisory_filenam:7,sudo:1,calcul:7,customlog:7,tag:[7,8,9,2],htype:7,ambigu:4,add_cooki:7,delai:7,http_lock:7,sid:7,instead:[2,4,7,10,8,11,9],application_path:[7,8],circular:11,overridden:7,constructor:[7,12],egg_count:7,attent:2,mod_ssl:[7,11],redund:11,addendum:2,physic:[7,9],alloc:2,loglevel:7,bind:[11,2],counter:7,correspond:[7,11],element:[7,10,9,4],issu:[11,7,1,2,4],allow:[4,7,10,8,11,9],elif:10,creation:[11,7,10],pythonfixuphandl:[10,8,11,12],move:[11,7,1],module_magic_number_major:7,m_updat:7,chosen:[8,1,11],browsermatchnocas:10,site_python:8,therefor:[1,4,6,7,8,9],link_nam:11,flex:[11,7,1],crash:11,greater:[7,11],handl:[1,5,7,8,9,11,12],overal:11,handi:7,devel:1,memberlist:11,mention:7,facilit:6,mywedir:9,cleanup_ch:7,minimalist:7,somewher:4,anyth:7,edit:[6,1,4],clength:7,tran:8,register_cleanup:[11,7,8],prepackag:[],mode:[10,7,1,11],truth:10,subset:[5,11],intellig:2,chunk:[7,11],getlist:7,"static":[10,7,8,9],conn_rec:7,meth:7,special:[7,11,2],out:[1,2,4,6,7,8,10,9],variabl:[10,7,8,11,4],http_expectation_fail:7,defend:2,req:[1,4,7,10,8,11,9],facto:7,categori:5,error_log:7,suitabl:[7,1],rel:7,rec:8,modpython:[11,7,1],red:5,shut:7,insid:[11,7,8,9,4],sendmail:9,manipul:[10,7,8],dictionari:[11,7,10,4],http_internal_server_error:[7,9],releas:[7,2],shortest:11,log:[1,6,7,8,11,9],indent:[10,7,1],could:[4,7,10,8,11,9],put:[],keep:[7,11],counterpart:[7,2],length:[7,11,4],outsid:[11,7,8,4],retain:[7,2],dbm_session:[7,8],south:2,softwar:[1,3,2],isbn:2,qualiti:7,echo:7,date:[11,8,2],sent_bodyct:7,owner:[1,2],suffic:7,prioriti:8,limit_req_lin:7,ancient:11,unknown:[],licens:[3,2,12],system:[7,1,2,4],wrapper:[7,11],attach:[11,2],attack:11,privaci:7,query_arg:7,termin:[7,11,2],"final":8,big:[11,2],startup:[11,7,8],commenturl:7,biggest:7,exactli:[1,4,7,8,12,9],strictli:7,http_multi_statu:7,bother:1,requesthandl:7,structur:[6,7,10,4],charact:[7,11,2],keep_alive_max:7,htaccess:[8,7,1,11,4],sens:7,other:[1,2,4,5,7,8,9,10,11,12],apr_finfo_min:7,corrupt:11,have:[1,2,4,7,10,8,11,9],tabl:[10,7,8,11,12],need:[1,2,4,7,10,8,11,9],ap_mpmq_min_spare_thread:7,remote_nolookup:7,aplog_emerg:7,min:7,atim:7,indemn:2,which:[1,2,4,5,6,7,8,10,11,9],ap_mpmq_max_daemon_us:7,singl:[1,5,6,7,8,11],directorymatch:[11,8],unless:[1,2,4,7,8,9],freebsd:11,main_serv:[7,11],discov:11,stoppag:2,"class":[2,4,7,10,8,11,12],placement:6,latin1:7,url:[1,4,5,7,8,11,9],request:[1,4,5,6,7,8,9,10,11,12],uri:[11,7,8,9,4],parsed_uri:7,determin:[1,2,4,7,8,11],fact:[7,9,2],psp_parser:[11,1],dbm:[7,11],http_not_accept:7,text:[7,1,9,2,4],filetyp:7,bring:8,server_nam:7,dbmtype:7,trivial:7,co_nam:7,redirect:[7,11],locat:[1,4,6,7,8,11,9],init_lock:7,auth_typ:[7,11],should:[1,2,4,6,7,8,11,9],suppos:7,local:[8,7,1],meant:[6,7,11,2],contribut:2,convert:[11,7,10,9],sysv:[],increas:[5,1],ssl_cipher:7,enabl:[1,7,10,8,11,12],strict_pars:7,stuff:[1,9],integr:[5,2],contain:[1,2,4,7,10,8,11],view:7,m_move:7,legaci:[11,4],allowed_method:[7,11],start_respons:[11,4],accord:[7,1],malfunct:2,modulu:7,statu:[11,7,8,9,4],error:[8,7,1,11,9],correctli:[11,7,10],pattern:11,add_input_filt:[7,11],favor:[],state:[5,7,11,12,2],crude:5,neither:[7,11],email:9,m_copi:7,kei:[2,4,7,10,8,11],marchal:7,tempfil:7,ap_mpmq_max_requests_daemon:7,joe:[7,4],lawsuit:2,addit:[7,11,9,2],deadlock:11,admin:7,etc:[1,2,4,5,7,8,9],instanc:[11,6,7,10,4],futher:7,uncaught:8,locationmatch:[11,8],strftime:7,comment:[2,4,7,10,11,9],guidelin:7,wrap:[7,11,4],read_bodi:[7,11],distin:6,respect:[7,11,4],filterdispatch:11,rpm:[],quit:[11,9,2],tort:2,http_length_requir:7,trademark:2,compon:7,besid:2,treat:[7,11],loadmodul:1,immedi:[7,9,2,4],presenc:4,ssl_client_cert:7,deliber:2,present:[7,11],parse_qsl:[7,11],multi:[7,4],apply_fs_data:11,plain:[7,1,9,4],empti:[11,7,8,4],unsuit:7,defin:[1,2,4,6,7,11],mutex_lock:[8,1,11],almost:7,site:[11,7,1,12,4],req_sendfil:11,archiv:2,substanti:7,server_protocol:7,incom:[6,7],revis:2,goliv:11,undecid:7,ap_mpmq_hard_limit_thread:7,parti:[11,2],cross:[7,11,2],member:[11,7,8,12,4],python:[0,1,2,4,5,6,7,8,9,10,11,12],failur:[7,2],infer:7,difficult:7,unmatch:4,http:[1,2,4,5,6,7,9,11,12],hostnam:7,denot:7,keepal:[7,11],upon:[8,7,1],effect:[8,7,1,11,9],get_config:[11,7,10],addoutputfilt:[10,7,8],php:2,off:[11,7,8,9],well:[1,2,4,5,7,8,10,11],versatil:7,thought:7,exampl:[2,4,6,7,8,9,12],command:[1,6,7,8,11,12],filesystem:[7,8,4],undefin:7,undertaken:[],http_not_impl:7,usual:[8,7,1,9,4],less:[7,11,9,2],pythong:6,obtain:[7,8,9,2],tcp:7,detail:[4,5,7,8,11,9],ependency_mtim:7,delete_on_clos:7,signedcooki:7,web:[1,2,4,5,7,12],rapid:4,onward:7,makefil:[11,1],add:[1,2,4,7,10,8,11],myscript:[9,4],server_admin:7,mp_server:[7,12],ought:4,match:[11,7,8,12,4],gmt:7,royalti:2,httpd_version:7,piec:7,five:7,know:[7,10,9],password:[7,8,9,4],recurs:7,python2:[8,1],loss:2,resid:[10,4],like:[2,4,7,10,8,11,9],lost:[],stagin:11,necessari:[10,6,7,1,12],headers_in:7,heed:[],page:[1,2,4,7,10,11,9],pass_on:7,drop:[9,4],suppli:[7,11],"export":11,flush:[7,11],proper:[],guarante:11,fileinfo:1,librari:[11,7,1,2,4],tmp:[7,1],win32:11,lead:7,leak:[11,4],avoid:[11,7,10,4],m_delet:7,session_directori:[7,8],outgo:7,log_error:[7,11],settl:4,server_port:7,encourag:8,delv:[],slight:7,stringfil:7,symlink:11,vhost:7,host:[11,7,8],m_option:7,although:[7,10,2],offset:7,simpler:11,about:[9,0,11,6,12],actual:[1,4,6,7,8,11,9],socket:7,irix:11,awai:4,discard:[7,11,4],certainti:[],remote_host:[7,11],disabl:[10,8,7,1],aplog_info:7,own:[2,4,6,7,8,9,10,12],http_gateway_time_out:7,automat:[10,7,8,11,4],marshalcooki:7,warranti:2,install_stat:[],subcommand:6,pointless:7,mere:[7,2],mod_python:[1,2,3,4,5,6,7,8,9,10,11,12],van:2,val:7,transfer:[7,2],intention:2,trigger:[7,11],"var":[7,1],pythontranshandl:[11,8,12],"function":[1,4,5,7,8,9,10,11,12],subdirectori:[8,9],subscrib:1,neutral:[],gain:8,eas:[],bug:[7,11,12],count:7,made:[8,7,1,11,2],cleanup:[7,8],watter:2,whether:[8,7,1,9,2],"_data2":[],"_data1":[],writeabl:7,displai:[7,2,4],record:7,below:[1,2,4,5,7,9],limit:[10,8,7,1,2],indefinit:7,otherwis:[7,11,2],problem:[11,7,1],register_output_filt:[7,11],evalu:[10,8,11],headers_out:[7,9],dure:[7,8,9,4],filenam:[11,7,8,9,4],meaningless:7,implement:[4,5,7,10,8,11],mtime:7,probabl:11,double_revers:7,quot:2,percent:2,http_not_found:[7,11,9,4],virtual:[11,7,8],book:2,lookup:7,futur:[7,11],rememb:[7,8,9],pythoninterp:7,servernam:7,stat:[7,11],repeat:7,dbmsession:[7,11],proto_num:7,keep_alive_timeout:7,pspcach:7,dependency_mtim:7,debian:[],wild_nam:[7,11],moved_perman:7,sphinx:0,eoj:4,indirectli:[7,4],rule:[11,7,8],portion:[7,4],livewir:2,cleanup_session_timeout:8},objtypes:{"0":"std:option","1":"py:module","2":"py:attribute","3":"py:class","4":"py:method","5":"py:function"},titles:["About these documents","Installation","History and License","Copyright","Standard Handlers","Introduction","Command Line Tool - mod_python","Python API","Apache Configuration Directives","Tutorial","Server Side Includes","Changes","Mod_python Documentation"],objnames:{"0":"option","1":"Python module","2":"Python attribute","3":"Python class","4":"Python method","5":"Python function"},filenames:["about","installation","license","copyright","handlers","introduction","commandline","pythonapi","directives","tutorial","ssi","changes","contents"]}) \ No newline at end of file diff --git a/doc-html/ssi.html b/doc-html/ssi.html deleted file mode 100644 index f8f1246e10d3c34fb0f3a9e562554512efc47c6c..0000000000000000000000000000000000000000 --- a/doc-html/ssi.html +++ /dev/null @@ -1,351 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Server Side Includes — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Changes" href="changes.html" /> - <link rel="prev" title="Command Line Tool - mod_python" href="commandline.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="changes.html" title="Changes" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="commandline.html" title="Command Line Tool - mod_python" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="server-side-includes"> -<span id="ssi"></span><h1>Server Side Includes<a class="headerlink" href="#server-side-includes" title="Permalink to this headline">¶</a></h1> -<div class="section" id="overview-of-ssi"> -<span id="ssi-overview"></span><h2>Overview of SSI<a class="headerlink" href="#overview-of-ssi" title="Permalink to this headline">¶</a></h2> -<p>SSI (Server Side Includes) are directives that are placed in HTML pages, -and evaluated on the server while the pages are being served. They let you -add dynamically generated content to an existing HTML page, without having -to serve the entire page via a CGI program, or other dynamic technology -such as a mod_python handler.</p> -<p>SSI directives have the following syntax::</p> -<div class="highlight-python"><pre><!--#element attribute=value attribute=value ... --></pre> -</div> -<p>It is formatted like an HTML comment, so if you don’t have SSI correctly -enabled, the browser will ignore it, but it will still be visible in the -HTML source. If you have SSI correctly configured, the directive will be -replaced with its results.</p> -<p>For a more thorough description of the SSI mechanism and how to enable it, -see the <a class="reference external" href="http://httpd.apache.org/docs/2.0/howto/ssi.html">SSI tutorial</a> -provided with the Apache documentation.</p> -<p>Version 3.3 of mod_python introduces support for using Python code within -SSI files. Note that mod_python honours the intent of the Apache -<tt class="docutils literal"><span class="pre">IncludesNOEXEC</span></tt> option to the <tt class="docutils literal"><span class="pre">Options</span></tt> directive. That is, if -<tt class="docutils literal"><span class="pre">IncludesNOEXEC</span></tt> is enabled, then Python code within a SSI file will -not be executed.</p> -</div> -<div class="section" id="using-python-code"> -<span id="ssi-python-code"></span><h2>Using Python Code<a class="headerlink" href="#using-python-code" title="Permalink to this headline">¶</a></h2> -<p>The extensions to mod_python to allow Python code to be used in conjunction -with SSI introduces the new SSI directive called <tt class="docutils literal"><span class="pre">'python'</span></tt>. This directive -can be used in two forms, these being <tt class="docutils literal"><span class="pre">'eval'</span></tt> and <tt class="docutils literal"><span class="pre">'exec'</span></tt> modes. In the case -of <tt class="docutils literal"><span class="pre">'eval'</span></tt>, a Python expression is used and it is the result of that -expression which is substituted in place into the page.:</p> -<div class="highlight-python"><pre><!--#python eval="10*'HELLO '" --> -<!--#python eval="len('HELLO')" --></pre> -</div> -<p>Where the result of the expression is not a string, the value will be -automatically converted to a string by applying <tt class="docutils literal"><span class="pre">'str()'</span></tt> to the value.</p> -<p>In the case of <tt class="docutils literal"><span class="pre">'exec'</span></tt> a block of Python code may be included. For any -output from this code to appear in the page, it must be written back -explicitly as being part of the response. As SSI are processed by an Apache -output filter, this is done by using an instance of the mod_python -<tt class="docutils literal"><span class="pre">filter</span></tt> object which is pushed into the global data set available to -the code.:</p> -<div class="highlight-python"><pre><!--#python exec=" -filter.write(10*'HELLO ') -filter.write(str(len('HELLO'))) -" --></pre> -</div> -<p>Any Python code within the <tt class="docutils literal"><span class="pre">'exec'</span></tt> block must have a zero first level -indent. You cannot start the code block with an arbitrary level of indent -such that it lines up with any indenting used for surrounding HTML -elements.</p> -<p>Although the mod_python <tt class="docutils literal"><span class="pre">filter</span></tt> object is not a true file object, that -it provides the <tt class="docutils literal"><span class="pre">write()</span></tt> method is sufficient to allow the <tt class="docutils literal"><span class="pre">print</span></tt> -statement to be used on it directly. This will avoid the need to explicitly -convert non string objects to a string before being output.:</p> -<div class="highlight-python"><pre><!--#python exec=" -print >> filter, len('HELLO') -" --></pre> -</div> -</div> -<div class="section" id="scope-of-global-data"> -<span id="ssi-data-scope"></span><h2>Scope of Global Data<a class="headerlink" href="#scope-of-global-data" title="Permalink to this headline">¶</a></h2> -<p>Multiple instances of <tt class="docutils literal"><span class="pre">'eval'</span></tt> or <tt class="docutils literal"><span class="pre">'exec'</span></tt> code blocks may be used within the -one page. Any changes to or creation of global data which is performed -within one code block will be reflected in any following code blocks. -Global data constitutes variables as well as module imports, function and -class definitions.:</p> -<div class="highlight-python"><pre><!--#python exec=" -import cgi, time, os -def _escape(object): - return cgi.escape(str(object)) -now = time.time() -" --> -<html> -<body> -<pre> -<!--#python eval="_escape(time.asctime(time.localtime(now)))"--> - -<!--#python exec=" -keys = os.environ.keys() -keys.sort() -for key in keys: - print >> filter, _escape(key), - print >> filter, '=', - print >> filter, _escape(repr(os.environ.get(key))) -" --> -</pre> -</body> -</html></pre> -</div> -<p>The lifetime of any global data is for the current request only. If data -must persist between requests, it must reside in external modules and as -necessary be protected against multithreaded access in the event that a -multithreaded Apache MPM is used.</p> -</div> -<div class="section" id="pre-populating-globals"> -<span id="ssi-globals"></span><h2>Pre-populating Globals<a class="headerlink" href="#pre-populating-globals" title="Permalink to this headline">¶</a></h2> -<p>Any Python code which appears within the page has to be compiled each time -the page is accessed before it is executed. In other words, the compiled -code is not cached between requests. To limit such recompilation and to -avoid duplication of common code amongst many pages, it is preferable to -pre-populate the global data from within a mod_python handler prior to the -page being processed.</p> -<p>In most cases, a fixup handler would be used for this purpose. For this to -work, first need to configure Apache so that it knows to call the fixup -handler.:</p> -<div class="highlight-python"><pre>PythonFixupHandler _handlers</pre> -</div> -<p>The implementation of the fixup handler contained in <tt class="docutils literal"><span class="pre">_handlers.py</span></tt> -then needs to create an instance of a Python dictionary, store that in the -mod_python request object as <tt class="docutils literal"><span class="pre">ssi_globals</span></tt> and then populate that -dictionary with any data to be available to the Python code executing -within the page.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="kn">import</span> <span class="nn">cgi</span><span class="o">,</span> <span class="nn">time</span> - -<span class="k">def</span> <span class="nf">_escape</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span> - <span class="k">return</span> <span class="n">cgi</span><span class="o">.</span><span class="n">escape</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="nb">object</span><span class="p">))</span> - -<span class="k">def</span> <span class="nf">_header</span><span class="p">(</span><span class="nb">filter</span><span class="p">):</span> - <span class="k">print</span> <span class="o">>></span> <span class="nb">filter</span><span class="p">,</span> <span class="s">'...'</span> - -<span class="k">def</span> <span class="nf">_footer</span><span class="p">(</span><span class="nb">filter</span><span class="p">):</span> - <span class="k">print</span> <span class="o">>></span> <span class="nb">filter</span><span class="p">,</span> <span class="s">'...'</span> - -<span class="k">def</span> <span class="nf">fixuphandler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="n">req</span><span class="o">.</span><span class="n">ssi_globals</span> <span class="o">=</span> <span class="p">{}</span> - <span class="n">req</span><span class="o">.</span><span class="n">ssi_globals</span><span class="p">[</span><span class="s">'time'</span><span class="p">]</span> <span class="o">=</span> <span class="n">time</span> - <span class="n">req</span><span class="o">.</span><span class="n">ssi_globals</span><span class="p">[</span><span class="s">'_escape'</span><span class="p">]</span> <span class="o">=</span> <span class="n">_escape</span> - <span class="n">req</span><span class="o">.</span><span class="n">ssi_globals</span><span class="p">[</span><span class="s">'_header'</span><span class="p">]</span> <span class="o">=</span> <span class="n">_header</span> - <span class="n">req</span><span class="o">.</span><span class="n">ssi_globals</span><span class="p">[</span><span class="s">'_footer'</span><span class="p">]</span> <span class="o">=</span> <span class="n">_footer</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -<p>This is most useful where it is necessary to insert common information such -as headers, footers or menu panes which are dynamically generated into many -pages.:</p> -<div class="highlight-python"><pre><!--#python exec=" -now = time.time() -" --> -<html> -<body> -<!--#python exec="_header(filter)" --> -<pre> -<!--#python eval="_escape(time.asctime(time.localtime(now)))"--> -</pre> -<!--#python exec="_footer(filter)" --> -</body> -</html></pre> -</div> -</div> -<div class="section" id="conditional-expressions"> -<span id="ssi-conditionals"></span><h2>Conditional Expressions<a class="headerlink" href="#conditional-expressions" title="Permalink to this headline">¶</a></h2> -<p>SSI allows for some programmability in its own right through the use of -conditional expressions. The structure of this conditional construct is::</p> -<div class="highlight-python"><pre><!--#if expr="test_condition" --> -<!--#elif expr="test_condition" --> -<!--#else --> -<!--#endif --></pre> -</div> -<p>A test condition can be any sort of logical comparison, either comparing -values to one another, or testing the ‘truth’ of a particular value.</p> -<p>The source of variables used in conditional expressions is distinct from -the set of global data used by the Python code executed within a page. -Instead, the variables are sourced from the <tt class="docutils literal"><span class="pre">subprocess_env</span></tt> table -object contained within the request object. The values of these variables -can be set from within a page using the SSI <tt class="docutils literal"><span class="pre">'set'</span></tt> directive, or by a range -of other Apache directives within the Apache configuration files such as -<tt class="docutils literal"><span class="pre">BrowserMatchNoCase</span></tt> and <tt class="docutils literal"><span class="pre">SetEnvIf</span></tt>.</p> -<p>To set these variables from within a mod_python handler, the -<tt class="docutils literal"><span class="pre">subprocess_env</span></tt> table object would be manipulated directly through -the request object.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">fixuphandler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="n">debug</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">get_config</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">'PythonDebug'</span><span class="p">,</span> <span class="s">'0'</span><span class="p">)</span> - <span class="n">req</span><span class="o">.</span><span class="n">subprocess_env</span><span class="p">[</span><span class="s">'DEBUG'</span><span class="p">]</span> <span class="o">=</span> <span class="n">debug</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -<p>If being done from within Python code contained within the page itself, the -request object would first have to be accessed via the filter object.:</p> -<div class="highlight-python"><pre><!--#python exec=" -debug = filter.req.get_config().get('PythonDebug', '0') -filter.req.subprocess_env['DEBUG'] = debug -" --> -<html> -<body> -<!--#if expr="${DEBUG} != 0" --> -DEBUG ENABLED -<!--#else --> -DEBUG DISABLED -<!--#endif --> -</body> -</html></pre> -</div> -</div> -<div class="section" id="enabling-includes-filter"> -<span id="ssi-output-filter"></span><h2>Enabling INCLUDES Filter<a class="headerlink" href="#enabling-includes-filter" title="Permalink to this headline">¶</a></h2> -<p>SSI is traditionally enabled using the <tt class="docutils literal"><span class="pre">AddOutputFilter</span></tt> directive in -the Apache configuration files. Normally this would be where the request -mapped to a static file.:</p> -<div class="highlight-python"><pre>AddOutputFilter INCLUDES .shtml</pre> -</div> -<p>When mod_python is being used, the ability to dynamically enable output -filters for the current request can instead be used. This could be done -just for where the request maps to a static file, but may just as easily be -carried out where the content of a response is generated dynamically. In -either case, to enable SSI for the current request, the -<tt class="xref py py-meth docutils literal"><span class="pre">request.add_output_filter()</span></tt> method of the mod_python request object would be -used.:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">fixuphandler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="n">req</span><span class="o">.</span><span class="n">add_output_filter</span><span class="p">(</span><span class="s">'INCLUDES'</span><span class="p">)</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Server Side Includes</a><ul> -<li><a class="reference internal" href="#overview-of-ssi">Overview of SSI</a></li> -<li><a class="reference internal" href="#using-python-code">Using Python Code</a></li> -<li><a class="reference internal" href="#scope-of-global-data">Scope of Global Data</a></li> -<li><a class="reference internal" href="#pre-populating-globals">Pre-populating Globals</a></li> -<li><a class="reference internal" href="#conditional-expressions">Conditional Expressions</a></li> -<li><a class="reference internal" href="#enabling-includes-filter">Enabling INCLUDES Filter</a></li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="commandline.html" - title="previous chapter">Command Line Tool - mod_python</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="changes.html" - title="next chapter">Changes</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/ssi.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="changes.html" title="Changes" - >next</a> |</li> - <li class="right" > - <a href="commandline.html" title="Command Line Tool - mod_python" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/doc-html/tutorial.html b/doc-html/tutorial.html deleted file mode 100644 index 6ce8db6f881d046ea5788ff6e74a64f1dfad2c45..0000000000000000000000000000000000000000 --- a/doc-html/tutorial.html +++ /dev/null @@ -1,530 +0,0 @@ - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Tutorial — Mod_python v3.5.0-3.5.0 documentation</title> - <link rel="stylesheet" href="_static/default.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '3.5.0-3.5.0', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/sidebar.js"></script> - <link rel="author" title="About these documents" href="about.html" /> - <link rel="copyright" title="Copyright" href="copyright.html" /> - <link rel="top" title="Mod_python v3.5.0-3.5.0 documentation" href="index.html" /> - <link rel="next" title="Python API" href="pythonapi.html" /> - <link rel="prev" title="Installation" href="installation.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="pythonapi.html" title="Python API" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="installation.html" title="Installation" - accesskey="P">previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="bodywrapper"> - <div class="body"> - - <div class="section" id="tutorial"> -<span id="id1"></span><h1>Tutorial<a class="headerlink" href="#tutorial" title="Permalink to this headline">¶</a></h1> -<p><em>So how can I make this work?</em></p> -<p>This is a quick guide to getting started with mod_python programming -once you have it installed. This is not an installation manual.</p> -<p>It is also highly recommended to read (at least the top part of) -the section <a class="reference internal" href="pythonapi.html#pythonapi"><em>Python API</em></a> after completing this tutorial.</p> -<div class="section" id="a-quick-start-with-the-publisher-handler"> -<span id="tut-pub"></span><h2>A Quick Start with the Publisher Handler<a class="headerlink" href="#a-quick-start-with-the-publisher-handler" title="Permalink to this headline">¶</a></h2> -<p>This section provides a quick overview of the Publisher handler for -those who would like to get started without getting into too much -detail. A more thorough explanation of how mod_python handlers work -and what a handler actually is follows on in the later sections of the -tutorial.</p> -<p>The <a class="reference internal" href="handlers.html#hand-pub"><em>Publisher Handler</em></a> is provided as one of the standard -mod_python handlers. To get the publisher handler working, you will -need the following lines in your config:</p> -<div class="highlight-python"><pre>AddHandler mod_python .py -PythonHandler mod_python.publisher -PythonDebug On</pre> -</div> -<p>The following example demonstrates a simple feedback form. The form -asks for a name, e-mail address and a comment which are then used to -construct and send a message to the webmaster. This simple -application consists of two files: <tt class="file docutils literal"><span class="pre">form.html</span></tt> - the form to -collect the data, and <tt class="file docutils literal"><span class="pre">form.py</span></tt> - the target of the form’s -action.</p> -<p>Here is the html for the form:</p> -<div class="highlight-python"><pre><html> - Please provide feedback below: -<p> -<form action="form.py/email" method="POST"> - - Name: <input type="text" name="name"><br> - Email: <input type="text" name="email"><br> - Comment: <textarea name="comment" rows=4 cols=20></textarea><br> - <input type="submit"> - -</form> -</html></pre> -</div> -<p>The <tt class="docutils literal"><span class="pre">action</span></tt> element of the <tt class="docutils literal"><span class="pre"><form></span></tt> tag points to -<tt class="docutils literal"><span class="pre">form.py/email</span></tt>. We are going to create a file called -<tt class="file docutils literal"><span class="pre">form.py</span></tt>, like this:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">smtplib</span> - -<span class="n">WEBMASTER</span> <span class="o">=</span> <span class="s">"webmaster"</span> <span class="c"># webmaster e-mail</span> -<span class="n">SMTP_SERVER</span> <span class="o">=</span> <span class="s">"localhost"</span> <span class="c"># your SMTP server</span> - -<span class="k">def</span> <span class="nf">email</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">email</span><span class="p">,</span> <span class="n">comment</span><span class="p">):</span> - - <span class="c"># make sure the user provided all the parameters</span> - <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">name</span> <span class="ow">and</span> <span class="n">email</span> <span class="ow">and</span> <span class="n">comment</span><span class="p">):</span> - <span class="k">return</span> <span class="s">"A required parameter is missing, </span><span class="se">\</span> -<span class="s"> please go back and correct the error"</span> - - <span class="c"># create the message text</span> - <span class="n">msg</span> <span class="o">=</span> <span class="s">"""</span><span class="se">\</span> -<span class="s">From: </span><span class="si">%s</span><span class="s"></span> -<span class="s">Subject: feedback</span> -<span class="s">To: </span><span class="si">%s</span><span class="s"></span> - -<span class="s">I have the following comment:</span> - -<span class="si">%s</span><span class="s"></span> - -<span class="s">Thank You,</span> - -<span class="si">%s</span><span class="s"></span> - -<span class="s">"""</span> <span class="o">%</span> <span class="p">(</span><span class="n">email</span><span class="p">,</span> <span class="n">WEBMASTER</span><span class="p">,</span> <span class="n">comment</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> - - <span class="c"># send it out</span> - <span class="n">conn</span> <span class="o">=</span> <span class="n">smtplib</span><span class="o">.</span><span class="n">SMTP</span><span class="p">(</span><span class="n">SMTP_SERVER</span><span class="p">)</span> - <span class="n">conn</span><span class="o">.</span><span class="n">sendmail</span><span class="p">(</span><span class="n">email</span><span class="p">,</span> <span class="p">[</span><span class="n">WEBMASTER</span><span class="p">],</span> <span class="n">msg</span><span class="p">)</span> - <span class="n">conn</span><span class="o">.</span><span class="n">quit</span><span class="p">()</span> - - <span class="c"># provide feedback to the user</span> - <span class="n">s</span> <span class="o">=</span> <span class="s">"""</span><span class="se">\</span> -<span class="s"><html></span> - -<span class="s">Dear </span><span class="si">%s</span><span class="s">,<br></span> -<span class="s">Thank You for your kind comments, we</span> -<span class="s">will get back to you shortly.</span> - -<span class="s"></html>"""</span> <span class="o">%</span> <span class="n">name</span> - - <span class="k">return</span> <span class="n">s</span> -</pre></div> -</div> -<p>When the user clicks the Submit button, the publisher handler will -load the <tt class="xref py py-func docutils literal"><span class="pre">email()</span></tt> function in the <tt class="xref py py-mod docutils literal"><span class="pre">form</span></tt> module, -passing it the form fields as keyword arguments. It will also pass the -request object as <tt class="docutils literal"><span class="pre">req</span></tt>.</p> -<p>You do not have to have <tt class="docutils literal"><span class="pre">req</span></tt> as one of the arguments if you do not -need it. The publisher handler is smart enough to pass your function -only those arguments that it will accept.</p> -<p>The data is sent back to the browser via the return value of the -function.</p> -<p>Even though the Publisher handler simplifies mod_python programming a -great deal, all the power of mod_python is still available to this -program, since it has access to the request object. You can do all the -same things you can do with a “native” mod_python handler, e.g. set -custom headers via <tt class="docutils literal"><span class="pre">req.headers_out</span></tt>, return errors by raising -<tt class="xref py py-exc docutils literal"><span class="pre">apache.SERVER_ERROR</span></tt> exceptions, write or read directly to -and from the client via <tt class="xref py py-meth docutils literal"><span class="pre">req.write()</span></tt> and <tt class="xref py py-meth docutils literal"><span class="pre">req.read()</span></tt>, -etc.</p> -<p>Read Section <a class="reference internal" href="handlers.html#hand-pub"><em>Publisher Handler</em></a> for more information on the publisher -handler.</p> -</div> -<div class="section" id="quick-overview-of-how-apache-handles-requests"> -<span id="tut-overview"></span><h2>Quick Overview of how Apache Handles Requests<a class="headerlink" href="#quick-overview-of-how-apache-handles-requests" title="Permalink to this headline">¶</a></h2> -<p>Apache processes requests in <em class="dfn">phases</em>. For example, the first -phase may be to authenticate the user, the next phase to verify -whether that user is allowed to see a particular file, then (next -phase) read the file and send it to the client. A typical static file -request involves three phases: (1) translate the requested URI to a -file location (2) read the file and send it to the client, then (3) -log the request. Exactly which phases are processed and how varies -greatly and depends on the configuration.</p> -<p>A <em class="dfn">handler</em> is a function that processes one phase. There may be -more than one handler available to process a particular phase, in -which case they are called by Apache in sequence. For each of the -phases, there is a default Apache handler (most of which by default -perform only very basic functions or do nothing), and then there are -additional handlers provided by Apache modules, such as mod_python.</p> -<p>Mod_python provides every possible handler to Apache. Mod_python -handlers by default do not perform any function, unless specifically -told so by a configuration directive. These directives begin with -<tt class="docutils literal"><span class="pre">'Python'</span></tt> and end with <tt class="docutils literal"><span class="pre">'Handler'</span></tt> -(e.g. <tt class="docutils literal"><span class="pre">PythonAuthenHandler</span></tt>) and associate a phase with a Python -function. So the main function of mod_python is to act as a dispatcher -between Apache handlers and Python functions written by a developer -like you.</p> -<p>The most commonly used handler is <tt class="docutils literal"><span class="pre">PythonHandler</span></tt>. It handles the -phase of the request during which the actual content is -provided. Because it has no name, it is sometimes referred to as as -<em class="dfn">generic</em> handler. The default Apache action for this handler is -to read the file and send it to the client. Most applications you will -write will provide this one handler. To see all the possible -handlers, refer to Section <a class="reference internal" href="directives.html#directives"><em>Apache Configuration Directives</em></a>.</p> -</div> -<div class="section" id="so-what-exactly-does-mod-python-do"> -<span id="tut-what-it-do"></span><h2>So what Exactly does Mod-python do?<a class="headerlink" href="#so-what-exactly-does-mod-python-do" title="Permalink to this headline">¶</a></h2> -<p>Let’s pretend we have the following configuration:</p> -<div class="highlight-python"><pre><Directory /mywebdir> - AddHandler mod_python .py - PythonHandler myscript - PythonDebug On -</Directory></pre> -</div> -<p>Note: <tt class="docutils literal"><span class="pre">/mywebdir</span></tt> is an absolute physical path in this case.</p> -<p>And let’s say that we have a python program (Windows users: substitute -forward slashes for backslashes) <tt class="file docutils literal"><span class="pre">/mywedir/myscript.py</span></tt> that looks like -this:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - - <span class="n">req</span><span class="o">.</span><span class="n">content_type</span> <span class="o">=</span> <span class="s">"text/plain"</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">)</span> - - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -<p>Here is what’s going to happen: The <tt class="docutils literal"><span class="pre">AddHandler</span></tt> directive tells -Apache that any request for any file ending with <tt class="file docutils literal"><span class="pre">.py</span></tt> in the -<tt class="file docutils literal"><span class="pre">/mywebdir</span></tt> directory or a subdirectory thereof needs to be -processed by mod_python. The <tt class="docutils literal"><span class="pre">'PythonHandler</span> <span class="pre">myscript'</span></tt> directive -tells mod_python to process the generic handler using the -<cite>myscript</cite> script. The <tt class="docutils literal"><span class="pre">'PythonDebug</span> <span class="pre">On'</span></tt> directive instructs -mod_python in case of an Python error to send error output to the -client (in addition to the logs), very useful during development.</p> -<p>When a request comes in, Apache starts stepping through its request -processing phases calling handlers in mod_python. The mod_python -handlers check whether a directive for that handler was specified in -the configuration. (Remember, it acts as a dispatcher.) In our -example, no action will be taken by mod_python for all handlers except -for the generic handler. When we get to the generic handler, -mod_python will notice <tt class="docutils literal"><span class="pre">'PythonHandler</span> <span class="pre">myscript'</span></tt> directive and do -the following:</p> -<ul> -<li><p class="first">If not already done, prepend the directory in which the -<tt class="docutils literal"><span class="pre">PythonHandler</span></tt> directive was found to <tt class="docutils literal"><span class="pre">sys.path</span></tt>.</p> -</li> -<li><p class="first">Attempt to import a module by name <tt class="docutils literal"><span class="pre">myscript</span></tt>. (Note that if -<tt class="docutils literal"><span class="pre">myscript</span></tt> was in a subdirectory of the directory where -<tt class="docutils literal"><span class="pre">PythonHandler</span></tt> was specified, then the import would not work -because said subdirectory would not be in the <tt class="docutils literal"><span class="pre">sys.path</span></tt>. One -way around this is to use package notation, e.g. -<tt class="docutils literal"><span class="pre">'PythonHandler</span> <span class="pre">subdir.myscript'</span></tt>.)</p> -</li> -<li><p class="first">Look for a function called <tt class="docutils literal"><span class="pre">handler</span></tt> in module <tt class="docutils literal"><span class="pre">myscript</span></tt>.</p> -</li> -<li><p class="first">Call the function, passing it a request object. (More on what a -request object is later).</p> -</li> -<li><p class="first">At this point we’re inside the script, let’s examine it line-by-line:</p> -<ul> -<li><div class="first highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> -</pre></div> -</div> -<p>This imports the apache module which provides the interface to -Apache. With a few rare exceptions, every mod_python program will have -this line.</p> -</li> -</ul> -<ul id="index-0"> -<li><div class="first highlight-python"><pre>def handler(req):</pre> -</div> -<p>This is our <em class="dfn">handler</em> function declaration. It -is called <tt class="docutils literal"><span class="pre">'handler'</span></tt> because mod_python takes the name of the -directive, converts it to lower case and removes the word -<tt class="docutils literal"><span class="pre">'python'</span></tt>. Thus <tt class="docutils literal"><span class="pre">'PythonHandler'</span></tt> becomes -<tt class="docutils literal"><span class="pre">'handler'</span></tt>. You could name it something else, and specify it -explicitly in the directive using <tt class="docutils literal"><span class="pre">'::'</span></tt>. For example, if the -handler function was called <tt class="docutils literal"><span class="pre">'spam'</span></tt>, then the directive would -be <tt class="docutils literal"><span class="pre">'PythonHandler</span> <span class="pre">myscript::spam'</span></tt>.</p> -<p>Note that a handler must take one argument - the <a class="reference internal" href="pythonapi.html#pyapi-mprequest"><em>Request Object</em></a>. -The request object is an object that provides all of the -information about this particular request - such as the IP of -client, the headers, the URI, etc. The communication back to the -client is also done via the request object, i.e. there is no -“response” object.</p> -</li> -<li><div class="first highlight-python"><div class="highlight"><pre><span class="n">req</span><span class="o">.</span><span class="n">content_type</span> <span class="o">=</span> <span class="s">"text/plain"</span> -</pre></div> -</div> -<p>This sets the content type to <tt class="docutils literal"><span class="pre">'text/plain'</span></tt>. The default is -usually <tt class="docutils literal"><span class="pre">'text/html'</span></tt>, but because our handler does not produce -any html, <tt class="docutils literal"><span class="pre">'text/plain'</span></tt> is more appropriate. You should always -make sure this is set <em>before</em> any call to <tt class="docutils literal"><span class="pre">'req.write'</span></tt>. When -you first call <tt class="docutils literal"><span class="pre">'req.write'</span></tt>, the response HTTP header is sent -to the client and all subsequent changes to the content type (or -other HTTP headers) have no effect.</p> -</li> -<li><div class="first highlight-python"><div class="highlight"><pre><span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">)</span> -</pre></div> -</div> -<p>This writes the <tt class="docutils literal"><span class="pre">'Hello</span> <span class="pre">World!'</span></tt> string to the client.</p> -</li> -<li><div class="first highlight-python"><div class="highlight"><pre><span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -<p>This tells Apache that everything went OK and that the request has -been processed. If things did not go OK, this line could return -<tt class="xref py py-const docutils literal"><span class="pre">apache.HTTP_INTERNAL_SERVER_ERROR</span></tt> or -<tt class="xref py py-const docutils literal"><span class="pre">apache.HTTP_FORBIDDEN</span></tt>. When things do not go OK, Apache -logs the error and generates an error message for the client.</p> -</li> -</ul> -</li> -</ul> -<div class="admonition note"> -<p class="first admonition-title">Note</p> -<p class="last">It is important to understand that in order for the handler code to -be executed, the URL needs not refer specficially to -<tt class="file docutils literal"><span class="pre">myscript.py</span></tt>. The only requirement is that it refers to a -<tt class="file docutils literal"><span class="pre">.py</span></tt> file. This is because the <tt class="docutils literal"><span class="pre">AddHandler</span> <span class="pre">mod_python</span> <span class="pre">.py</span></tt> -directive assignes mod_python to be a handler for a file <em>type</em> -(based on extention <tt class="docutils literal"><span class="pre">.py</span></tt>), not a specific file. Therefore the -name in the URL does not matter, in fact the file referred to in the -URL doesn’t event have to exist. Given the above configuration, -<tt class="docutils literal"><span class="pre">'http://myserver/mywebdir/myscript.py'</span></tt> and -<tt class="docutils literal"><span class="pre">'http://myserver/mywebdir/montypython.py'</span></tt> would yield the exact -same result.</p> -</div> -</div> -<div class="section" id="now-something-more-complicated-authentication"> -<span id="tut-more-complicated"></span><h2>Now something More Complicated - Authentication<a class="headerlink" href="#now-something-more-complicated-authentication" title="Permalink to this headline">¶</a></h2> -<p>Now that you know how to write a basic handler, let’s try -something more complicated.</p> -<p>Let’s say we want to password-protect this directory. We want the -login to be <tt class="docutils literal"><span class="pre">'spam'</span></tt>, and the password to be <tt class="docutils literal"><span class="pre">'eggs'</span></tt>.</p> -<p>First, we need to tell Apache to call our <em>authentication</em> -handler when authentication is needed. We do this by adding the -<tt class="docutils literal"><span class="pre">PythonAuthenHandler</span></tt>. So now our config looks like this:</p> -<div class="highlight-python"><pre><Directory /mywebdir> - AddHandler mod_python .py - PythonHandler myscript - PythonAuthenHandler myscript - PythonDebug On -</Directory></pre> -</div> -<p>Notice that the same script is specified for two different -handlers. This is fine, because if you remember, mod_python will look -for different functions within that script for the different handlers.</p> -<p>Next, we need to tell Apache that we are using Basic HTTP -authentication, and only valid users are allowed (this is fairly basic -Apache stuff, so we’re not going to go into details here). Our config -looks like this now:</p> -<div class="highlight-python"><pre><Directory /mywebdir> - AddHandler mod_python .py - PythonHandler myscript - PythonAuthenHandler myscript - PythonDebug On - AuthType Basic - AuthName "Restricted Area" - require valid-user -</Directory></pre> -</div> -<p>Note that depending on which version of Apache is being used, you may need -to set either the code{AuthAuthoritative} or <tt class="docutils literal"><span class="pre">AuthBasicAuthoritative</span></tt> -directive to <tt class="docutils literal"><span class="pre">Off</span></tt> to tell Apache that you want allow the task of -performing basic authentication to fall through to your handler.</p> -<p>Now we need to write an authentication handler function in -<tt class="file docutils literal"><span class="pre">myscript.py</span></tt>. A basic authentication handler would look like -this:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">authenhandler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - - <span class="n">pw</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">get_basic_auth_pw</span><span class="p">()</span> - <span class="n">user</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">user</span> - - <span class="k">if</span> <span class="n">user</span> <span class="o">==</span> <span class="s">"spam"</span> <span class="ow">and</span> <span class="n">pw</span> <span class="o">==</span> <span class="s">"eggs"</span><span class="p">:</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> - <span class="k">else</span><span class="p">:</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">HTTP_UNAUTHORIZED</span> -</pre></div> -</div> -<p>Let’s look at this line by line:</p> -<ul> -<li><div class="first highlight-python"><pre>def authenhandler(req):</pre> -</div> -<p>This is the handler function declaration. This one is called -<tt class="docutils literal"><span class="pre">authenhandler</span></tt> because, as we already described above, -mod_python takes the name of the directive -(<tt class="docutils literal"><span class="pre">PythonAuthenHandler</span></tt>), drops the word <tt class="docutils literal"><span class="pre">'Python'</span></tt> and converts -it lower case.</p> -</li> -<li><div class="first highlight-python"><div class="highlight"><pre><span class="n">pw</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">get_basic_auth_pw</span><span class="p">()</span> -</pre></div> -</div> -<p>This is how we obtain the password. The basic HTTP authentication -transmits the password in base64 encoded form to make it a little -bit less obvious. This function decodes the password and returns it -as a string. Note that we have to call this function before obtaining -the user name.</p> -</li> -<li><div class="first highlight-python"><div class="highlight"><pre><span class="n">user</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">user</span> -</pre></div> -</div> -<p>This is how you obtain the username that the user entered.</p> -</li> -<li><div class="first highlight-python"><div class="highlight"><pre><span class="k">if</span> <span class="n">user</span> <span class="o">==</span> <span class="s">"spam"</span> <span class="ow">and</span> <span class="n">pw</span> <span class="o">==</span> <span class="s">"eggs"</span><span class="p">:</span> - <span class="k">return</span> <span class="n">apache</span><span class="o">.</span><span class="n">OK</span> -</pre></div> -</div> -<p>We compare the values provided by the user, and if they are what we -were expecting, we tell Apache to go ahead and proceed by returning -<tt class="xref py py-const docutils literal"><span class="pre">apache.OK</span></tt>. Apache will then consider this phase of the -request complete, and proceed to the next phase. (Which in this case -would be <tt class="xref py py-func docutils literal"><span class="pre">handler()</span></tt> if it’s a <tt class="docutils literal"><span class="pre">'.py'</span></tt> file).</p> -</li> -<li><div class="first highlight-python"><pre>else: - return apache.HTTP_UNAUTHORIZED</pre> -</div> -<p>Else, we tell Apache to return <tt class="xref py py-const docutils literal"><span class="pre">HTTP_UNAUTHORIZED</span></tt> to the -client, which usually causes the browser to pop a dialog box asking -for username and password.</p> -</li> -</ul> -</div> -<div class="section" id="your-own-404-handler"> -<span id="tut-404-handler"></span><h2>Your Own 404 Handler<a class="headerlink" href="#your-own-404-handler" title="Permalink to this headline">¶</a></h2> -<p>In some cases, you may wish to return a 404 (<tt class="xref py py-const docutils literal"><span class="pre">HTTP_NOT_FOUND</span></tt>) or -other non-200 result from your handler. There is a trick here. if you -return <tt class="xref py py-const docutils literal"><span class="pre">HTTP_NOT_FOUND</span></tt> from your handler, Apache will handle -rendering an error page. This can be problematic if you wish your handler -to render it’s own error page.</p> -<p>In this case, you need to set <tt class="docutils literal"><span class="pre">req.status</span> <span class="pre">=</span> <span class="pre">apache.HTTP_NOT_FOUND</span></tt>, -render your page, and then <tt class="docutils literal"><span class="pre">return(apache.OK)</span></tt>:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">mod_python</span> <span class="kn">import</span> <span class="n">apache</span> - -<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">req</span><span class="p">):</span> - <span class="k">if</span> <span class="n">req</span><span class="o">.</span><span class="n">filename</span><span class="p">[</span><span class="o">-</span><span class="mi">17</span><span class="p">:]</span> <span class="o">==</span> <span class="s">'apache-error.html'</span><span class="p">:</span> - <span class="c"># make Apache report an error and render the error page</span> - <span class="k">return</span><span class="p">(</span><span class="n">apache</span><span class="o">.</span><span class="n">HTTP_NOT_FOUND</span><span class="p">)</span> - <span class="k">if</span> <span class="n">req</span><span class="o">.</span><span class="n">filename</span><span class="p">[</span><span class="o">-</span><span class="mi">18</span><span class="p">:]</span> <span class="o">==</span> <span class="s">'handler-error.html'</span><span class="p">:</span> - <span class="c"># use our own error page</span> - <span class="n">req</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">apache</span><span class="o">.</span><span class="n">HTTP_NOT_FOUND</span> - <span class="n">pagebuffer</span> <span class="o">=</span> <span class="s">'Page not here. Page left, not know where gone.'</span> - <span class="k">else</span><span class="p">:</span> - <span class="c"># use the contents of a file</span> - <span class="n">pagebuffer</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">filename</span><span class="p">,</span> <span class="s">'r'</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span> - - <span class="c"># fall through from the latter two above</span> - <span class="n">req</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">pagebuffer</span><span class="p">)</span> - <span class="k">return</span><span class="p">(</span><span class="n">apache</span><span class="o">.</span><span class="n">OK</span><span class="p">)</span> -</pre></div> -</div> -<p>Note that if wishing to returning an error page from a handler phase other -than the response handler, the value <tt class="docutils literal"><span class="pre">apache.DONE</span></tt> must be returned -instead of <tt class="docutils literal"><span class="pre">apache.OK</span></tt>. If this is not done, subsequent handler phases -will still be run. The value of <tt class="docutils literal"><span class="pre">apache.DONE</span></tt> indicates that processing -of the request should be stopped immediately. If using stacked response -handlers, then <tt class="docutils literal"><span class="pre">apache.DONE</span></tt> should also be returned in that situation -to prevent subsequent handlers registered for that phase being run if -appropriate.</p> -</div> -</div> - - - </div> - </div> - </div> - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - <h3><a href="contents.html">Table Of Contents</a></h3> - <ul> -<li><a class="reference internal" href="#">Tutorial</a><ul> -<li><a class="reference internal" href="#a-quick-start-with-the-publisher-handler">A Quick Start with the Publisher Handler</a></li> -<li><a class="reference internal" href="#quick-overview-of-how-apache-handles-requests">Quick Overview of how Apache Handles Requests</a></li> -<li><a class="reference internal" href="#so-what-exactly-does-mod-python-do">So what Exactly does Mod-python do?</a></li> -<li><a class="reference internal" href="#now-something-more-complicated-authentication">Now something More Complicated - Authentication</a></li> -<li><a class="reference internal" href="#your-own-404-handler">Your Own 404 Handler</a></li> -</ul> -</li> -</ul> - - <h4>Previous topic</h4> - <p class="topless"><a href="installation.html" - title="previous chapter">Installation</a></p> - <h4>Next topic</h4> - <p class="topless"><a href="pythonapi.html" - title="next chapter">Python API</a></p> - <h3>This Page</h3> - <ul class="this-page-menu"> - <li><a href="_sources/tutorial.txt" - rel="nofollow">Show Source</a></li> - </ul> -<div id="searchbox" style="display: none"> - <h3>Quick search</h3> - <form class="search" action="search.html" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - Enter search terms or a module, class or function name. - </p> -</div> -<script type="text/javascript">$('#searchbox').show(0);</script> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li class="right" > - <a href="py-modindex.html" title="Python Module Index" - >modules</a> |</li> - <li class="right" > - <a href="pythonapi.html" title="Python API" - >next</a> |</li> - <li class="right" > - <a href="installation.html" title="Installation" - >previous</a> |</li> - <li><a href="contents.html">Mod_python v3.5.0-3.5.0 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © <a href="copyright.html">Copyright</a> 1990-2013, Apache Software Foundation, Gregory Trubetskoy. - Last updated on Nov 13, 2013. - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. - </div> - </body> -</html> \ No newline at end of file diff --git a/lib/python/mod_python/Cookie.py b/lib/python/mod_python/Cookie.py index 7205722e87a6097e1380cbcaeb12ba8f0dd862a4..a22d69731a56e928feed77b52f71721d17fa1ce5 100644 --- a/lib/python/mod_python/Cookie.py +++ b/lib/python/mod_python/Cookie.py @@ -59,7 +59,7 @@ class metaCookie(type): _valid_attr = ( "version", "path", "domain", "secure", - "comment", "max_age", + "comment", "expires", "max_age", "samesite", # RFC 2965 "commentURL", "discard", "port", # Microsoft Extension @@ -74,6 +74,10 @@ class metaCookie(type): clsdict["_valid_attr"] = _valid_attr clsdict["__slots__"] = __slots__ + return type.__new__(cls, clsname, bases, clsdict) + + def __init__(cls, clsname, bases, clsdict): + def set_expires(self, value): if type(value) == type(""): @@ -96,9 +100,7 @@ class metaCookie(type): def get_expires(self): return self._expires - clsdict["expires"] = property(fget=get_expires, fset=set_expires) - - return type.__new__(cls, clsname, bases, clsdict) + cls.expires = property(fget=get_expires, fset=set_expires) # metaclass= workaround, see # http://mikewatkins.ca/2008/11/29/python-2-and-3-metaclasses/#using-the-metaclass-in-python-2-x-and-3-x @@ -350,7 +352,7 @@ def _parse_cookie(str, Class, names=None): # We just ditch the cookies names which start with a dollar sign since # those are in fact RFC2965 cookies attributes. See bug [#MODPYTHON-3]. - if key[0]!='$' and names is None or key in names: + if key[0]!='$' and (names is None or key in names): result[key] = Class(key, val) return result diff --git a/lib/python/mod_python/Session.py b/lib/python/mod_python/Session.py index 38694c28cf04852244db784ed4da7c184d7cda56..40b2b53a9d65cc16e5a651e82fe0ec4c68fbc649 100644 --- a/lib/python/mod_python/Session.py +++ b/lib/python/mod_python/Session.py @@ -124,7 +124,7 @@ def _new_sid(req): g = _get_generator() rnd1 = g.randint(0, 999999999) rnd2 = g.randint(0, 999999999) - ip = req.connection.remote_ip + ip = req.connection.client_ip return md5_hash("%d%d%d%d%s" % (t, pid, rnd1, rnd2, ip)) @@ -338,9 +338,9 @@ def unlock_session_cleanup(sess): ## DbmSession def dbm_cleanup(data): - dbm, server = data + filename, server = data _apache._global_lock(server, None, 0) - db = dbm.open(dbm, 'c') + db = dbm.open(filename, 'c') try: old = [] s = db.first() diff --git a/lib/python/mod_python/apache.py b/lib/python/mod_python/apache.py index 7748108ece3b9129fcd2ea68884a01245b10ed40..53333db8a2f7769c8c7190634e7698a9318e8e5d 100644 --- a/lib/python/mod_python/apache.py +++ b/lib/python/mod_python/apache.py @@ -24,10 +24,14 @@ import time import os import pdb import stat -import imp +import inspect +import importlib import types -import cgi import _apache +try: + from html import escape +except: + from cgi import escape try: import threading @@ -549,7 +553,7 @@ class CallBack: s = '\n<pre>\nMod_python error: "%s %s"\n\n' % (phase, hname) for e in traceback.format_exception(etype, evalue, etb): - s = s + cgi.escape(e) + '\n' + s = s + escape(e) + '\n' s = s + "</pre>\n" if filter: @@ -578,79 +582,63 @@ def import_module(module_name, autoreload=1, log=0, path=None): # nlehuen: this is a big lock, we'll have to refine it later to get better performance. # For now, we'll concentrate on thread-safety. - imp.acquire_lock() - try: - # (Re)import - if module_name in sys.modules: + # (Re)import + if module_name in sys.modules: - # The module has been imported already - module = sys.modules[module_name] - oldmtime, mtime = 0, 0 + # The module has been imported already + module = sys.modules[module_name] + oldmtime, mtime = 0, 0 - if autoreload: + if autoreload: - # but is it in the path? + # but is it in the path? + try: + file = module.__dict__["__file__"] + except KeyError: + file = None + + # the "and not" part of this condition is to prevent execution + # of arbitrary already imported modules, such as os. The + # reason we use startswith as opposed to exact match is that + # modules inside packages are actually in subdirectories. + + if not file or (path and not list(filter(file.startswith, path))): + # there is a script by this name already imported, but it's in + # a different directory, therefore it's a different script + mtime, oldmtime = 0, -1 # trigger import + else: try: - file = module.__dict__["__file__"] + last_check = module.__dict__["__mtime_check__"] except KeyError: - file = None - - # the "and not" part of this condition is to prevent execution - # of arbitrary already imported modules, such as os. The - # reason we use startswith as opposed to exact match is that - # modules inside packages are actually in subdirectories. - - if not file or (path and not list(filter(file.startswith, path))): - # there is a script by this name already imported, but it's in - # a different directory, therefore it's a different script - mtime, oldmtime = 0, -1 # trigger import - else: - try: - last_check = module.__dict__["__mtime_check__"] - except KeyError: - last_check = 0 + last_check = 0 - if (time.time() - last_check) > 1: - oldmtime = module.__dict__.get("__mtime__", 0) - mtime = module_mtime(module) - else: - pass + if (time.time() - last_check) > 1: + oldmtime = module.__dict__.get("__mtime__", 0) + mtime = module_mtime(module) else: - mtime, oldmtime = 0, -1 + pass + else: + mtime, oldmtime = 0, -1 - if mtime != oldmtime: + if mtime != oldmtime: - # Import the module - if log: - if path: - s = "mod_python: (Re)importing module '%s' with path set to '%s'" % (module_name, path) - else: - s = "mod_python: (Re)importing module '%s'" % module_name - _apache.log_error(s, APLOG_NOTICE) + # Import the module + if log: + if path: + s = "mod_python: (Re)importing module '%s' with path set to '%s'" % (module_name, path) + else: + s = "mod_python: (Re)importing module '%s'" % module_name + _apache.log_error(s, APLOG_NOTICE) - parent = None - parts = module_name.split('.') - for i in range(len(parts)): - f, p, d = imp.find_module(parts[i], path) - try: - mname = ".".join(parts[:i+1]) - module = imp.load_module(mname, f, p, d) - if parent: - setattr(parent,parts[i],module) - parent = module - finally: - if f: f.close() - if hasattr(module, "__path__"): - path = module.__path__ + parent = None + module = importlib.import_module(module_name) - if mtime == 0: - mtime = module_mtime(module) + if mtime == 0: + mtime = module_mtime(module) - module.__mtime__ = mtime + module.__mtime__ = mtime - return module - finally: - imp.release_lock() + return module def module_mtime(module): """Get modification time of module""" @@ -706,9 +694,9 @@ def resolve_object(module, obj_str, arg=None, silent=0): obj = getattr(obj, obj_str) - if hasattr(obj, "im_self") and not obj.__self__: - # this is an unbound method, its class - # needs to be instantiated + if inspect.isclass(parent): + # The parent of this object is a class, + # it needs to be instantiated instance = parent(arg) obj = getattr(instance, obj_str) @@ -984,6 +972,7 @@ HTTP_REQUEST_URI_TOO_LARGE = 414 HTTP_UNSUPPORTED_MEDIA_TYPE = 415 HTTP_RANGE_NOT_SATISFIABLE = 416 HTTP_EXPECTATION_FAILED = 417 +HTTP_IM_A_TEAPOT = 418 HTTP_UNPROCESSABLE_ENTITY = 422 HTTP_LOCKED = 423 HTTP_FAILED_DEPENDENCY = 424 diff --git a/lib/python/mod_python/psp.py b/lib/python/mod_python/psp.py index f994847e97eb369d04cbf1713f34a464b2e21566..398ded64870e00d805b0c785cb74e34fc106019f 100644 --- a/lib/python/mod_python/psp.py +++ b/lib/python/mod_python/psp.py @@ -25,9 +25,14 @@ import sys import os import marshal import types -from cgi import escape import dbm, dbm import tempfile +try: + from html import escape +except: + from cgi import escape + +PY2 = sys.version[0] == '2' # dbm types for cache dbm_types = {} @@ -268,7 +273,10 @@ class PSP: # run error page psp.error_page.run({"exception": (et, ev, etb)}, flush) else: - raise et(ev).with_traceback(etb) + if PY2: + exec('raise et, ev, etb') + else: + raise et(ev).with_traceback(etb) finally: # if session was created here, unlock it and don't leave # it behind in request object in unlocked state as it diff --git a/lib/python/mod_python/util.py b/lib/python/mod_python/util.py index b1d1d4baf353efdce4f5d62fe3eec8bff0cc6aa3..67d6b3fd36be35c4d5e0e073b40ec0887b70286e 100644 --- a/lib/python/mod_python/util.py +++ b/lib/python/mod_python/util.py @@ -156,7 +156,11 @@ else: disp_options = None def __new__(self, value): - return bytes.__new__(self, value) + if PY2: + return bytes.__new__(self, value) + else: + str_value = value.decode("utf-8") if isinstance(value, bytes) else value + return bytes.__new__(self, str(str_value), encoding="utf-8") def __init__(self, value): self.value = value @@ -245,7 +249,7 @@ class FieldStorage: # always process GET-style parameters if req.args: - pairs = parse_qsl(req.args, keep_blank_values) + pairs = self.parse_qsl_safely(req.args, keep_blank_values) for pair in pairs: self.add_field(pair[0], pair[1]) @@ -270,7 +274,7 @@ class FieldStorage: v = req.read(clen) if not isinstance(v, bytes): raise TypeError("req.read() must return bytes") - pairs = parse_qsl(v, keep_blank_values) + pairs = self.parse_qsl_safely(v, keep_blank_values) for pair in pairs: self.add_field(pair[0], pair[1]) return @@ -393,6 +397,22 @@ class FieldStorage: field.headers = headers self.list.append(field) + def parse_qsl_safely(self, query_string, keep_blank_values): + """ + This script calls urllib.parse.parse_qsl if there is exception in processing parse_qsl function + + :param query_string: The query string which needs to be parsed + :type query_string: string + :param keep_blank_values: keep_blank_values is a flag indicating whether blank values in percent-encoded queries should be treated as blank strings. + :type keep_blank_values: int/boolean + """ + try: + pairs = parse_qsl(query_string, keep_blank_values) + except SystemError as er: + import urllib.parse + pairs = urllib.parse.parse_qsl(query_string, keep_blank_values) + return pairs + def add_field(self, key, value): """Insert a field as key/value pair""" item = StringField(value) diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 5519a2b887584335b80c7287f108421056a0916d..726bc71950be6fc70ebdb5b0d4888ec070888938 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -17,7 +17,7 @@ # INSTALL=@INSTALL@ -BINDIR=@prefix@/bin +BINDIR=`dirname @PYTHON_BIN@` clean: rm -rf *~ @@ -26,4 +26,5 @@ distclean: clean rm -f Makefile install: + $(INSTALL) -m 0755 -d $(DESTDIR)$(BINDIR) $(INSTALL) -m 0755 mod_python $(DESTDIR)$(BINDIR)/mod_python diff --git a/scripts/mod_python.in b/scripts/mod_python.in index 610c84ad20de776b14d890385bdfa23eb6252d67..b242c1ff1c07b77c1df99cefffe85a16ae4b147f 100644 --- a/scripts/mod_python.in +++ b/scripts/mod_python.in @@ -26,7 +26,7 @@ import sys import os import platform -import io +import StringIO import mod_python from mod_python import httpdconf @@ -64,7 +64,7 @@ def cmd_genconfig(): if len(args) != 1: parser.error("Must specify <src>") - exec(compile(open(args[0]).read(), args[0], 'exec')) + execfile(args[0]) def cmd_create(): diff --git a/src/Makefile.in b/src/Makefile.in index c3b3fb2b69bdc7fa1b4e765c44402f8643f92a3f..c32fac5f401f00803f00fa1cbe7eae5c99865e54 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -50,11 +50,11 @@ psp_parser.c: psp_parser.l dso: mod_python.so -mod_python.so: $(SRCS) @SOLARIS_HACKS@ +mod_python.so: $(SRCS) @SOLARIS_HACKS@ @echo @echo 'Building mod_python.so.' @echo - $(APXS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -c $(SRCS) $(LDFLAGS) $(LDLIBS) @SOLARIS_HACKS@ + $(APXS) $(INCLUDES) $(CPPFLAGS) $(APXSFLAGS) $(CFLAGS) -c $(SRCS) $(LDFLAGS) $(LDLIBS) @SOLARIS_HACKS@ @rm -f mod_python.so @ln -s .libs/mod_python.so mod_python.so clean: @@ -64,21 +64,17 @@ distclean: clean rm -f Makefile .depend version.c: - @MP_GIT_SHA=$$(git describe --always); \ - echo > version.c ; \ + @echo > version.c ; \ echo "/* THIS FILE IS AUTO-GENERATED BY Makefile */" >> version.c ; \ echo "#include \"mp_version.h\"" >> version.c ; \ - echo "const char * const mp_git_sha = \"$${MP_GIT_SHA}\";" >> version.c ; \ echo "const int mp_version_major = MP_VERSION_MAJOR;" >> version.c ; \ echo "const int mp_version_minor = MP_VERSION_MINOR;" >> version.c ; \ echo "const int mp_version_patch = MP_VERSION_PATCH;" >> version.c ; \ - echo "const char * const mp_version_string = MP_VERSION_STRING(MP_VERSION_MAJOR,MP_VERSION_MINOR,MP_VERSION_PATCH) \"-$${MP_GIT_SHA}\";" >> version.c ; \ - echo "const char * const mp_version_component = \"mod_python/\" MP_VERSION_STRING(MP_VERSION_MAJOR,MP_VERSION_MINOR,MP_VERSION_PATCH) \"-$${MP_GIT_SHA}\";" >> version.c - -# echo "const char * const mp_version_component = \"mod_python/\" #MP_VERSION_MAJOR \".\" #MP_VERSION_MINOR \".\" #MP_VERSION_PATCH \"-$${MP_GIT_SHA}\";" >> version.c + echo "const char * const mp_version_string = \"`../dist/version.sh`\";" >> version.c ; \ + echo "const char * const mp_version_component = \"mod_python/\" \"`../dist/version.sh`\";" >> version.c # this is a hack to help avoid a gcc/solaris problem -# python uses assert() which needs _eprintf(). See +# python uses assert() which needs _eprintf(). See # SOLARIS_HACKS above _eprintf.o: ar -x `gcc -print-libgcc-file-name` _eprintf.o diff --git a/src/_apachemodule.c b/src/_apachemodule.c index 1f273df35ef3ac21d5c49c654f22666539c63801..7fd2b34a171ef5563db8ec0aef7a2b242b6fa28b 100644 --- a/src/_apachemodule.c +++ b/src/_apachemodule.c @@ -24,7 +24,7 @@ #include "mod_python.h" -/* A referende to the _apache.SERVER_RETURN */ +/* A reference to the _apache.SERVER_RETURN */ PyObject *Mp_ServerReturn; @@ -213,17 +213,19 @@ static PyObject *parse_qs(PyObject *self, PyObject *args) cval = PyBytes_AS_STRING(val); if (unicode) { + // The query string is supposed to be a valid UTF8 string + // https://url.spec.whatwg.org/#percent-encoded-bytes PyObject *list, *ukey, *uval; - ukey = PyUnicode_DecodeLatin1(ckey, strlen(ckey), NULL); - uval = PyUnicode_DecodeLatin1(ckey, strlen(cval), NULL); + ukey = PyUnicode_DecodeUTF8(ckey, strlen(ckey), NULL); + uval = PyUnicode_DecodeUTF8(cval, strlen(cval), NULL); list = PyDict_GetItem(dict, ukey); if (list) { PyList_Append(list, uval); - Py_DECREF(uval); + Py_XDECREF(uval); } else { list = Py_BuildValue("[O]", uval); PyDict_SetItem(dict, ukey, list); - Py_DECREF(ukey); + Py_XDECREF(ukey); Py_DECREF(list); } } else { @@ -371,11 +373,11 @@ static PyObject *parse_qsl(PyObject *self, PyObject *args) PyObject *listitem = NULL; if (unicode) { PyObject *ukey, *uval; - ukey = PyUnicode_DecodeLatin1(ckey, strlen(ckey), NULL); - uval = PyUnicode_DecodeLatin1(cval, strlen(cval), NULL); + ukey = PyUnicode_DecodeUTF8(ckey, strlen(ckey), NULL); + uval = PyUnicode_DecodeUTF8(cval, strlen(cval), NULL); listitem = Py_BuildValue("(O,O)", ukey, uval); - Py_DECREF(ukey); - Py_DECREF(uval); + Py_XDECREF(ukey); + Py_XDECREF(uval); } else listitem = Py_BuildValue("(O,O)", key, val); if(listitem) { @@ -851,7 +853,12 @@ PyObject *_apache_module_init() #else m = PyModule_Create(&_apache_moduledef); PyObject *name = PyUnicode_FromString("_apache"); - _PyImport_FixupExtensionObject(m, name, name); + + _PyImport_FixupExtensionObject(m, name, name +#if PY_MINOR_VERSION >= 7 + ,PyImport_GetModuleDict() +#endif + ); #endif d = PyModule_GetDict(m); Mp_ServerReturn = PyErr_NewException("_apache.SERVER_RETURN", NULL, NULL); diff --git a/src/include/mod_python.h b/src/include/mod_python.h index 2c150d1748dc692e83f4bfde1da5a21420f6def0..68a77d465a595c4eb28ed5dd6b8fc45883f3b0f0 100644 --- a/src/include/mod_python.h +++ b/src/include/mod_python.h @@ -156,7 +156,6 @@ extern module AP_MODULE_DECLARE_DATA python_module; #define MUTEX_DIR "/tmp" /* version stuff */ -extern const char * const mp_git_sha; extern const int mp_version_major; extern const int mp_version_minor; extern const int mp_version_patch; @@ -267,7 +266,7 @@ APR_DECLARE_OPTIONAL_FN(PyObject *, mp_get_connection_object, (conn_rec *)); if (PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 && \ PyUnicode_KIND(obj) == PyUnicode_1BYTE_KIND) { \ if (obj_is_borrowed) Py_INCREF(obj); /* so DECREF ok */ \ - str = (char *)PyUnicode_1BYTE_DATA(obj); \ + str = PyUnicode_1BYTE_DATA(obj); \ } else { \ PyObject *latin = PyUnicode_AsLatin1String(obj); \ if (latin) { \ @@ -292,11 +291,11 @@ static inline PyObject *MpObject_ReprAsBytes(PyObject *o) { PyObject *result; PyObject *ucode = PyObject_Repr(o); /* we can do this because repr() should never have non-ascii characters XXX (really?) */ - char *c = (char *)PyUnicode_1BYTE_DATA(ucode); + char *c = PyUnicode_1BYTE_DATA(ucode); if (c[0] == 'b') - result = PyBytes_FromStringAndSize((char *)PyUnicode_1BYTE_DATA(ucode)+1, PyUnicode_GET_LENGTH(ucode)-1); + result = PyBytes_FromStringAndSize(PyUnicode_1BYTE_DATA(ucode)+1, PyUnicode_GET_LENGTH(ucode)-1); else - result = PyBytes_FromStringAndSize((char *)PyUnicode_1BYTE_DATA(ucode), PyUnicode_GET_LENGTH(ucode)); + result = PyBytes_FromStringAndSize(PyUnicode_1BYTE_DATA(ucode), PyUnicode_GET_LENGTH(ucode)); Py_DECREF(ucode); return result; } diff --git a/src/include/mod_python.h.in b/src/include/mod_python.h.in index 31b5517c2e3a452296b1f29aeb47f843ba06c0b9..7d536c52c80382ca58b963548a197581f617becc 100644 --- a/src/include/mod_python.h.in +++ b/src/include/mod_python.h.in @@ -156,7 +156,6 @@ extern module AP_MODULE_DECLARE_DATA python_module; #define MUTEX_DIR "@MUTEX_DIR@" /* version stuff */ -extern const char * const mp_git_sha; extern const int mp_version_major; extern const int mp_version_minor; extern const int mp_version_patch; @@ -267,7 +266,7 @@ APR_DECLARE_OPTIONAL_FN(PyObject *, mp_get_connection_object, (conn_rec *)); if (PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 && \ PyUnicode_KIND(obj) == PyUnicode_1BYTE_KIND) { \ if (obj_is_borrowed) Py_INCREF(obj); /* so DECREF ok */ \ - str = (char *)PyUnicode_1BYTE_DATA(obj); \ + str = PyUnicode_1BYTE_DATA(obj); \ } else { \ PyObject *latin = PyUnicode_AsLatin1String(obj); \ if (latin) { \ @@ -292,11 +291,11 @@ static inline PyObject *MpObject_ReprAsBytes(PyObject *o) { PyObject *result; PyObject *ucode = PyObject_Repr(o); /* we can do this because repr() should never have non-ascii characters XXX (really?) */ - char *c = (char *)PyUnicode_1BYTE_DATA(ucode); + char *c = PyUnicode_1BYTE_DATA(ucode); if (c[0] == 'b') - result = PyBytes_FromStringAndSize((char *)PyUnicode_1BYTE_DATA(ucode)+1, PyUnicode_GET_LENGTH(ucode)-1); + result = PyBytes_FromStringAndSize(PyUnicode_1BYTE_DATA(ucode)+1, PyUnicode_GET_LENGTH(ucode)-1); else - result = PyBytes_FromStringAndSize((char *)PyUnicode_1BYTE_DATA(ucode), PyUnicode_GET_LENGTH(ucode)); + result = PyBytes_FromStringAndSize(PyUnicode_1BYTE_DATA(ucode), PyUnicode_GET_LENGTH(ucode)); Py_DECREF(ucode); return result; } diff --git a/src/include/mp_version.h b/src/include/mp_version.h index 4b3a4947ef943b85fd62a8b12a4b366ab04ff281..5ed83a1f4016d78faa0bbda66cb2caafc83f2589 100644 --- a/src/include/mp_version.h +++ b/src/include/mp_version.h @@ -10,5 +10,3 @@ #define MP_VERSION_MINOR 5 #define MP_VERSION_PATCH 0 -#define STR(x) #x -#define MP_VERSION_STRING(maj, min, p) STR(maj) "." STR(min) "." STR(p) diff --git a/src/mod_python.c b/src/mod_python.c index 2fe01eaaf7ab1e5ed592bbcbf9ee2e51c92a577e..6259c1ba74877fa4023fd76d97eb1b1b859bf0a3 100644 --- a/src/mod_python.c +++ b/src/mod_python.c @@ -44,6 +44,16 @@ static APR_OPTIONAL_FN_TYPE(ap_register_include_handler) *optfn_register_include static APR_OPTIONAL_FN_TYPE(ap_ssi_get_tag_and_value) *optfn_ssi_get_tag_and_value; static APR_OPTIONAL_FN_TYPE(ap_ssi_parse_string) *optfn_ssi_parse_string; +/* + * Python3 uses wchar_t * for strings; Python2 uses char *. + * So for printing we need a different format string. + */ +#if PY_MAJOR_VERSION < 3 +# define PRIs "%s" +#else +# define PRIs "%ls" +#endif + /** ** make_obcallback ** @@ -747,11 +757,11 @@ static int python_init(apr_pool_t *p, apr_pool_t *ptemp, "python_init: Python version mismatch, expected '%s', found '%s'.", py_compile_version, py_dynamic_version); ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, - "python_init: Python executable found '%s'.", - (char *)Py_GetProgramFullPath()); + "python_init: Python executable found '" PRIs "'.", + Py_GetProgramFullPath()); ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, - "python_init: Python path being used '%s'.", - (char *)Py_GetPath()); + "python_init: Python path being used '" PRIs "'.", + Py_GetPath()); } /* Python version */ @@ -772,9 +782,29 @@ static int python_init(apr_pool_t *p, apr_pool_t *ptemp, { initialized = 1; - /* initialze the interpreter */ + /* disable user site directories */ + Py_NoUserSiteDirectory = 1; + + /* Initialze the main interpreter. */ +#if PY_MAJOR_VERSION == 2 && \ + (PY_MINOR_VERSION < 7 || (PY_MINOR_VERSION == 7 && PY_MICRO_VERSION < 14)) + /* + * We do not want site.py to + * be imported because as of Python 2.7.9 it would cause a + * circular dependency related to _locale which breaks + * graceful restart so we set Py_NoSiteFlag to 1 just for this + * one time. (https://github.com/grisha/mod_python/issues/46) + */ + Py_NoSiteFlag = 1; +#endif + Py_Initialize(); +#if PY_MAJOR_VERSION == 2 && \ + (PY_MINOR_VERSION < 7 || (PY_MINOR_VERSION == 7 && PY_MICRO_VERSION < 14)) + Py_NoSiteFlag = 0; +#endif + #ifdef WITH_THREAD /* create and acquire the interpreter lock */ PyEval_InitThreads(); @@ -1795,7 +1825,7 @@ static apr_status_t python_filter(int is_input, ap_filter_t *f, } /* are we in transparent mode? transparent mode is on after an error, - so a fitler can spit out an error without causing infinite loop */ + so a filter can spit out an error without causing infinite loop */ if (ctx->transparent) { if (is_input) return ap_get_brigade(f->next, bb, mode, block, readbytes); @@ -2646,7 +2676,7 @@ static void PythonChildInitHandler(apr_pool_t *p, server_rec *s) * problems as well. Thus disable cleanup of Python when * child processes are being shutdown. (MODPYTHON-109) * - apr_pool_cleanup_register(p, NULL, python_finalize, apr_pool_cleanup_null); + * apr_pool_cleanup_register(p, NULL, python_finalize, apr_pool_cleanup_null); */ /* diff --git a/src/requestobject.c b/src/requestobject.c index 7569335c0532821fd5851a3b70ca0a8cb1094544..65d42ace4b646971f39b9488d28c672cf5f76572 100644 --- a/src/requestobject.c +++ b/src/requestobject.c @@ -1967,6 +1967,10 @@ static int setreq_recmbr(requestobject *self, PyObject *val, void *name) return 0; } else if (strcmp(name, "args") == 0) { + if (val == Py_None) { + self->request_rec->args = 0; + return 0; + } MP_ANYSTR_AS_STR(v, val, 1); if (!v) { Py_DECREF(val); /* MP_ANYSTR_AS_STR */ @@ -2247,7 +2251,7 @@ static PyGetSetDef request_getsets[] = { {"no_local_copy", (getter)getreq_recmbr, (setter)setreq_recmbr, "There is no local copy of the response", "no_local_copy"}, {"unparsed_uri", (getter)getreq_recmbr, NULL, "The URI without any parsing performed", "unparsed_uri"}, {"filename", (getter)getreq_recmbr, (setter)setreq_recmbr, "The file name on disk that this request corresponds to", "filename"}, - {"canonical_filename", (getter)getreq_recmbr, (setter)setreq_recmbr, "The true filename (req.filename is canonicalized if they dont match)", "canonical_filename"}, + {"canonical_filename", (getter)getreq_recmbr, (setter)setreq_recmbr, "The true filename (req.filename is canonicalized if they don't match)", "canonical_filename"}, {"path_info", (getter)getreq_recmbr, (setter)setreq_recmbr, "Path_info, if any", "path_info"}, {"args", (getter)getreq_recmbr, (setter)setreq_recmbr, "QUERY_ARGS, if any", "args"}, {"finfo", (getter)getreq_rec_fi, (setter)setreq_recmbr, "File information", "finfo"}, diff --git a/test/test.py b/test/test.py index 4c52251d0a2635386641672c20e11cd70ea0cdd0..0739a89b8433b5d1b84d8d74d39e4e6e8f1dc593 100644 --- a/test/test.py +++ b/test/test.py @@ -310,6 +310,12 @@ class HttpdCtrl: modpath = LIBEXECDIR s = Container( + IfModule("!prefork.c", + IfModule("!worker.c", + IfModule("!perchild.c", + IfModule("!mpm_winnt.c", + LoadModule("mpm_prefork_module modules/mod_mpm_prefork.so"), + )))), IfModule("prefork.c", StartServers("3"), MaxSpareServers("1")),