~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/server/moinmodpy.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: iso-8859-1 -*-
 
2
"""
 
3
    MoinMoin - mod_python wrapper for broken mod_python versions
 
4
 
 
5
    add a .htaccess to the path below which you want to have your
 
6
    wiki instance:
 
7
 
 
8
    <Files wiki>
 
9
      SetHandler python-program
 
10
      PythonPath "['/path/to/share/moin/server'] + sys.path"
 
11
      PythonHandler moinmodpy
 
12
    </Files>
 
13
 
 
14
    Note: this is a wrapper needed because of a bug in
 
15
          mod_python < 3.1.3
 
16
 
 
17
 
 
18
    mod_python.apache.resolve_object fails to parse a object with dots.
 
19
 
 
20
    If you have a newer version, take a look at moinmodpy.htaccess
 
21
    to see how to use MoinMoin without this wrapper. You can also
 
22
    look into INSTALL.html to see how you can fix the bug on your own
 
23
    (a simple one line change).
 
24
 
 
25
    @copyright: 2004-2005 by Oliver Graf <ograf@bitart.de>
 
26
    @license: GNU GPL, see COPYING for details.
 
27
"""
 
28
 
 
29
import sys, os
 
30
 
 
31
# a) Configuration of Python's code search path
 
32
#    If you already have set up the PYTHONPATH environment variable for the
 
33
#    stuff you see below, you don't need to do a1) and a2).
 
34
 
 
35
# a1) Path of the directory where the MoinMoin code package is located.
 
36
#     Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
 
37
#sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
 
38
 
 
39
# a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
 
40
#     See wiki/config/... for some sample config files.
 
41
#sys.path.insert(0, '/path/to/wikiconfigdir')
 
42
#sys.path.insert(0, '/path/to/farmconfigdir')
 
43
 
 
44
# b) Configuration of moin's logging
 
45
#    If you have set up MOINLOGGINGCONF environment variable, you don't need this!
 
46
#    You also don't need this if you are happy with the builtin defaults.
 
47
#    See wiki/config/logging/... for some sample config files.
 
48
#from MoinMoin import log
 
49
#log.load_config('/path/to/logging_configuration_file')
 
50
 
 
51
# Debug mode - show detailed error reports
 
52
#os.environ['MOIN_DEBUG'] = '1'
 
53
 
 
54
 
 
55
from MoinMoin.server.server_modpython import ModpythonConfig, modpythonHandler
 
56
 
 
57
class MyConfig(ModpythonConfig):
 
58
    """ Set up local server-specific stuff here """
 
59
    # Properties
 
60
    # Allow overriding any request property by the value defined in
 
61
    # this dict e.g properties = {'script_name': '/mywiki'}.
 
62
    ## properties = {}
 
63
 
 
64
def handler(request):
 
65
    return modpythonHandler(request, MyConfig)
 
66