#!/usr/bin/python
# mfe_source_html.py
# (c) William Stein, 2003
# If the input is valid render the page.
import cgi, mfd, sys, mfe_source
print "Content-Type: text/html" # HTML is following
print # blank line, end of headers
def Get_Source():
form = cgi.FieldStorage()
if form.has_key("id"):
return mfd.Source(int(form["id"].value))
else:
print "Error - missing source id! Invalid URL."
sys.exit(0)
source = Get_Source()
mfe_source.Display_Page(source)