diff wiki/server/moinmodpy.py @ 2975:ea78a739b5ad

imported patch fix-modpython-patch (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 05 Jan 2008 21:46:35 +0100
parents b902f2397c68
children 806cf4814612
line wrap: on
line diff
--- a/wiki/server/moinmodpy.py	Sat Jan 05 21:30:45 2008 +0100
+++ b/wiki/server/moinmodpy.py	Sat Jan 05 21:46:35 2008 +0100
@@ -48,17 +48,23 @@
 ## import os
 ## os.environ['MOIN_DEBUG'] = '1'
 
-# Set threads flag, so other code can use proper locking.
-# TODO: It seems that modpy does not use threads, so we don't need to
-# set it here. Do we have another method to check this?
-from MoinMoin import config
-config.use_threads = 1
-del config
+# Simple way
+#from MoinMoin.server.server_modpython import modpythonHandler as handler
 
+# Complex way
+from MoinMoin.server.server_modpython import ModpythonConfig, modpythonHandler
 
-from MoinMoin.request import request_modpython
+class MyConfig(ModpythonConfig):
+    """ Set up local server-specific stuff here """
+
+    # Make sure moin will have permission to write to this file!
+    # Otherwise it will cause a server error.
+    logPath = "/var/log/apache2/moinlog"
+    
+    # Properties
+    # Allow overriding any request property by the value defined in
+    # this dict e.g properties = {'script_name': '/mywiki'}.
+    ## properties = {}
 
 def handler(request):
-    moinreq = request_modpython.Request(request)
-    return moinreq.run(request)
-
+    return modpythonHandler(request, MyConfig)