comparison wiki/server/moinmodpy.py @ 0:77665d8e2254

tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0 (automatically generated log message) imported from: moin--main--1.5--base-0
author Thomas Waldmann <tw-public@gmx.de>
date Thu, 22 Sep 2005 15:09:50 +0000
parents
children cf52f97a5857
comparison
equal deleted inserted replaced
-1:000000000000 0:77665d8e2254
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/moin/share/moin/cgi-bin'] + 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
26 @copyright: 2004-2005 by Oliver Graf <ograf@bitart.de>
27 @license: GNU GPL, see COPYING for details.
28 """
29
30 # System path configuration
31
32 import sys
33
34 # Path of the directory where wikiconfig.py is located.
35 # YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
36 sys.path.insert(0, '/path/to/wikiconfig')
37
38 # Path to MoinMoin package, needed if you installed with --prefix=PREFIX
39 # or if you did not use setup.py.
40 ## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
41
42 # Path of the directory where farmconfig is located (if different).
43 ## sys.path.insert(0, '/path/to/farmconfig')
44
45
46 # Set threads flag, so other code can use proper locking.
47 # TODO: It seems that modpy does not use threads, so we don't need to
48 # set it here. Do we have another method to check this?
49 from MoinMoin import config
50 config.use_threads = 1
51 del config
52
53
54 from MoinMoin.request import RequestModPy
55
56 def handler(request):
57 moinreq = RequestModPy(request)
58 return moinreq.run(request)
59