view wiki/server/moin.fcg @ 33:55ff4feb0f59

src cosmetics: remove TODOs, CVS stuff imported from: moin--main--1.5--patch-34
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 25 Sep 2005 11:36:51 +0000
parents 77665d8e2254
children cf52f97a5857
line wrap: on
line source
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - FastCGI Driver Script

    @copyright: 2004-2005 by Oliver Graf <ograf@bitart.de>
    @license: GNU GPL, see COPYING for details.
"""

# System path configuration

import sys

# Path of the directory where wikiconfig.py is located.
# YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
sys.path.insert(0, '/path/to/wikiconfig')

# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
# or if you did not use setup.py.
## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')

# Path of the directory where farmconfig is located (if different).
## sys.path.insert(0, '/path/to/farmconfig')


# Use threaded version or non-threaded version (default 1)?
use_threads = 1


# Code ------------------------------------------------------------------

# Do not touch unless you know what you are doing!
# TODO: move to server package?

# Set threads flag, so other code can use proper locking
from MoinMoin import config
config.use_threads = use_threads
del config

from MoinMoin.request import RequestFastCGI
from MoinMoin.support import thfcgi

def handle_request(req, env, form):
    request = RequestFastCGI(req, env, form)
    request.run()

if __name__ == '__main__':
    if use_threads:
        fcg = thfcgi.THFCGI(handle_request)
    else:
        fcg = thfcgi.unTHFCGI(handle_request)    

    fcg.run()