4
FCKeditor - The text editor for Internet - http://www.fckeditor.net
5
Copyright (C) 2003-2007 Frederico Caldeira Knabben
9
Licensed under the terms of any of the following licenses at your
12
- GNU General Public License Version 2 or later (the "GPL")
13
http://www.gnu.org/licenses/gpl.html
15
- GNU Lesser General Public License Version 2.1 or later (the "LGPL")
16
http://www.gnu.org/licenses/lgpl.html
18
- Mozilla Public License Version 1.1 or later (the "MPL")
19
http://www.mozilla.org/MPL/MPL-1.1.html
23
Connector/QuickUpload for Python (WSGI wrapper).
25
See config.py for configuration settings
29
from connector import FCKeditorConnector
30
from upload import FCKeditorQuickUpload
33
from cStringIO import StringIO
35
# Running from WSGI capable server (recomended)
36
def App(environ, start_response):
37
"WSGI entry point. Run the connector"
38
if environ['SCRIPT_NAME'].endswith("connector.py"):
39
conn = FCKeditorConnector(environ)
40
elif environ['SCRIPT_NAME'].endswith("upload.py"):
41
conn = FCKeditorQuickUpload(environ)
43
start_response ("200 Ok", [('Content-Type','text/html')])
44
yield "Unknown page requested: "
45
yield environ['SCRIPT_NAME']
49
data = conn.doResponse()
50
# Start WSGI response:
51
start_response ("200 Ok", conn.headers)
55
start_response("500 Internal Server Error",[("Content-type","text/html")])
57
cgitb.Hook(file = file).handle()