Back to index

moin  1.9.0~rc2
Functions
wsgi Namespace Reference

Functions

def App

Function Documentation

def wsgi.App (   environ,
  start_response 
)

Definition at line 36 of file wsgi.py.

00036 
00037 def App(environ, start_response):
00038        "WSGI entry point. Run the connector"
00039        if environ['SCRIPT_NAME'].endswith("connector.py"):
00040               conn = FCKeditorConnector(environ)
00041        elif environ['SCRIPT_NAME'].endswith("upload.py"):
00042               conn = FCKeditorQuickUpload(environ)
00043        else:
00044               start_response ("200 Ok", [('Content-Type','text/html')])
00045               yield "Unknown page requested: "
00046               yield environ['SCRIPT_NAME']
00047               return
00048        try:
00049               # run the connector
00050               data = conn.doResponse()
00051               # Start WSGI response:
00052               start_response ("200 Ok", conn.headers)
00053               # Send response text
00054               yield data
00055        except:
00056               start_response("500 Internal Server Error",[("Content-type","text/html")])
00057               file = StringIO()
00058               cgitb.Hook(file = file).handle()
00059               yield file.getvalue()

Here is the call graph for this function: