#!/usr/bin/python2.3 import cgi import cgitb; cgitb.enable() import os import sys debug = 0 if debug: for key in os.environ.keys(): value = os.environ.get(key) print key, value PATH_INFO = os.environ.get('PATH_INFO', '') if PATH_INFO == '/robots.txt': #print "Content-Type: text/plain\n\nUser-agent: *\nDisallow: /\n" print "Content-Type: text/plain\n\nUser-agent: msnbot/*\nDisallow: /\n" # And stop sys.exit(0) else: #GOOGLE does not index XHTML! #print "Content-Type: application/xhtml+xml" print "Content-Type: text/html" print from htmltmpl import TemplateManager, TemplateProcessor template = TemplateManager().prepare("basic.tmpl") tproc = TemplateProcessor() # By default cgi.escape tproc.set("code", open(__file__).read()) tproc.set("template", open("basic.tmpl").read()) #tproc.set("apache", open("/etc/apache/conf/robots.dabase.com.conf").read()) print tproc.process(template)