view MoinMoin/server/ @ 3070:ed1a433803c6

PEP8 fixes
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 22 Feb 2008 19:28:52 +0100
parents 8d691fbdc929
children 103fd9035d50
line wrap: on
line source

    MoinMoin - WSGI application

    Minimal code for using this:

    import logging
    from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp

    class Config(WsgiConfig):
        logPath = 'moin.log' # define your log file here
        #loglevel_file = logging.INFO # if you do not like the default

    config = Config() # you MUST create an instance to initialize logging!
    # use moinmoinApp here with your WSGI server / gateway

    @copyright: 2005 Anakim Border <>,
                2007 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.

from MoinMoin.server import Config
from MoinMoin.request import request_wsgi

class WsgiConfig(Config):
    """ WSGI default config """
    loglevel_stderr = None # we do not want to write to stderr!

def moinmoinApp(environ, start_response):
    request = request_wsgi.Request(environ)
    start_response(request.status, request.headers)
    return [request.output()]