diff -r 0a98cbe5e2eb -r ec68a0f75c58 site/index.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/site/index.py Tue Dec 02 03:05:04 2008 +0200 @@ -0,0 +1,44 @@ +#!/usr/bin/env python2.5 + +DEBUG = True + +# imports +if DEBUG : + import cgitb; cgitb.enable() + +# system modules +import cgi, os + +# my modules/packages +import request +import pages + +def dump_environ () : + print "" + +# main +def main (environ) : + # load our req + req = request.Request(environ, default_page='main') + + # get the page handler + page = pages.find(req) + + # render + print "Status: %d\r\n" % page.get_response_code(), + print "Content-Type: text/html\r\n", + print "\r\n", + print "%s\r\n" % page.render_template() + + # debug output + if DEBUG : + dump_environ() + +if __name__ == '__main__' : + main(os.environ) +