view MoinMoin/server/ @ 4510:6180f7b85a45

Modernized theme: make nonexistent links gray also when the yare already visited
author Radomir Dopieralski <>
date Sat, 24 Jan 2009 21:49:44 +0100
parents c0becca3d0d9
line wrap: on
line source
    MoinMoin - WSGI application

    Minimal code for using this:

    from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp

    class Config(WsgiConfig):

    config = Config() # you MUST create an instance
    # 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 """

def moinmoinApp(environ, start_response):
    request = request_wsgi.Request(environ)
    start_response(request.status, request.headers)
    if request._send_file is not None:
        # moin wants to send a file (e.g. AttachFile.do_get)
        def simple_wrapper(fileobj, bufsize):
            return iter(lambda:, '')
        file_wrapper = environ.get('wsgi.file_wrapper', simple_wrapper)
        return file_wrapper(request._send_file, request._send_bufsize)
        return [request.output()] # don't we have a filelike there also!?