2
MoinMoin - WSGI application
4
Minimal code for using this:
6
from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
8
class Config(WsgiConfig):
11
config = Config() # you MUST create an instance
12
# use moinmoinApp here with your WSGI server / gateway
14
@copyright: 2005 Anakim Border <akborder@gmail.com>,
15
2007 MoinMoin:ThomasWaldmann
16
@license: GNU GPL, see COPYING for details.
19
from MoinMoin.server import Config
20
from MoinMoin.request import request_wsgi
22
class WsgiConfig(Config):
23
""" WSGI default config """
27
def moinmoinApp(environ, start_response):
28
request = request_wsgi.Request(environ)
30
start_response(request.status, request.headers)
31
if request._send_file is not None:
32
# moin wants to send a file (e.g. AttachFile.do_get)
33
def simple_wrapper(fileobj, bufsize):
34
return iter(lambda: fileobj.read(bufsize), '')
35
file_wrapper = environ.get('wsgi.file_wrapper', simple_wrapper)
36
return file_wrapper(request._send_file, request._send_bufsize)
38
return [request.output()] # don't we have a filelike there also!?