annotate wiki/server/moinmodpy.py @ 4457:415cbfc3817b

merged moin/1.7
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 13 Dec 2008 19:27:41 +0100
parents fc2f05f2b0bd
children 315b15e9cd5e
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3 MoinMoin - mod_python wrapper for broken mod_python versions
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
5 add a .htaccess to the path below which you want to have your
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
6 wiki instance:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
7
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8 <Files wiki>
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
9 SetHandler python-program
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
10 PythonPath "['/path/to/share/moin/server'] + sys.path"
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
11 PythonHandler moinmodpy
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
12 </Files>
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
13
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
14 Note: this is a wrapper needed because of a bug in
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
15 mod_python < 3.1.3
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
17
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
18 mod_python.apache.resolve_object fails to parse a object with dots.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
19
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
20 If you have a newer version, take a look at moinmodpy.htaccess
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
21 to see how to use MoinMoin without this wrapper. You can also
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
22 look into INSTALL.html to see how you can fix the bug on your own
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
23 (a simple one line change).
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
24
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
25 @copyright: 2004-2005 by Oliver Graf <ograf@bitart.de>
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
26 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
27 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
28
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
29 import sys, os
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
30
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
31 # a) Configuration of Python's code search path
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
32 # If you already have set up the PYTHONPATH environment variable for the
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
33 # stuff you see below, you don't need to do a1) and a2).
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
34
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
35 # a1) Path of the directory where the MoinMoin code package is located.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
36 # Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
37 #sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
38
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
39 # a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
40 # See wiki/config/... for some sample config files.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
41 #sys.path.insert(0, '/path/to/wikiconfigdir')
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
42 #sys.path.insert(0, '/path/to/farmconfigdir')
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
43
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
44 # b) Configuration of moin's logging
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
45 # If you have set up MOINLOGGINGCONF environment variable, you don't need this!
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
46 # You also don't need this if you are happy with the builtin defaults.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
47 # See wiki/config/logging/... for some sample config files.
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
48 #from MoinMoin import log
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
49 #log.load_config('/path/to/logging_configuration_file')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
50
49
cf52f97a5857 merge moin--main--1.3--patch-928
Nir Soffer <nirs@freeshell.org>
parents: 0
diff changeset
51 # Debug mode - show detailed error reports
3580
fc2f05f2b0bd server adaptor scripts: make sys.path / logging configuration / comments consistent
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3505
diff changeset
52 #os.environ['MOIN_DEBUG'] = '1'
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
53
3111
79f850129782 logging: fix server scripts to load logging config, fix logging configs
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3105
diff changeset
54
2975
ea78a739b5ad imported patch fix-modpython-patch (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2338
diff changeset
55 from MoinMoin.server.server_modpython import ModpythonConfig, modpythonHandler
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
56
2975
ea78a739b5ad imported patch fix-modpython-patch (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2338
diff changeset
57 class MyConfig(ModpythonConfig):
ea78a739b5ad imported patch fix-modpython-patch (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2338
diff changeset
58 """ Set up local server-specific stuff here """
ea78a739b5ad imported patch fix-modpython-patch (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2338
diff changeset
59 # Properties
ea78a739b5ad imported patch fix-modpython-patch (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2338
diff changeset
60 # Allow overriding any request property by the value defined in
ea78a739b5ad imported patch fix-modpython-patch (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2338
diff changeset
61 # this dict e.g properties = {'script_name': '/mywiki'}.
ea78a739b5ad imported patch fix-modpython-patch (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2338
diff changeset
62 ## properties = {}
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
63
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
64 def handler(request):
2975
ea78a739b5ad imported patch fix-modpython-patch (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2338
diff changeset
65 return modpythonHandler(request, MyConfig)
3505
cd43bbf56c33 logging: removed logging to ./moin.log from fallback config, better docs
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3111
diff changeset
66