~vcs-imports/feedvalidator/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)