Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Commit 'shim' enabling Andrew's mod_python implementation to be run as

a CGI.


git-svn-id: http://feedvalidator.googlecode.com/svn/trunk/feedvalidator@123 34a10a33-d82d-0410-ba40-81c901463ecc
  • Loading branch information...
commit c884c78b99aca9b73dff75e05e9e2421712b30c0 1 parent 13eeef3
rubys authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 index.cgi
View
26 index.cgi
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+from config import *
+
+import cgi, cgitb, sys
+cgitb.enable()
+
+import codecs
+ENCODING='UTF-8'
+sys.stdout = codecs.getwriter(ENCODING)(sys.stdout)
+
+if SRCDIR not in sys.path:
+ sys.path.insert(0, SRCDIR)
+
+class request:
+ content_type = "text/html"
+
+from index import index
+
+fs = cgi.FieldStorage()
+req = request()
+url = fs.getvalue('url') or ''
+out = fs.getvalue('out') or 'xml'
+
+result=index(req,url,out)
+
+print "Content-type: %s\r\n\r\n%s" % (req.content_type, result)
Please sign in to comment.
Something went wrong with that request. Please try again.