#!/usr/bin/env python2 import cgi # enable debugging: displays detailed exceptions in web browser. import cgitb; cgitb.enable() import MySQLdb # temporary: eventually put 'effrecipes.py' into a standard PYTHONPATH # location, like /usr/lib/python2.3/site-packages/ import sys sys.path.append('/home/sussman/projects/effrecipes/objects') import effrecipes # ----------------------------------------------------------------- # Initialize database connection conn = MySQLdb.connect(user='effuser', passwd='effuser', db='effrecipes') # Initial generic HTML 'header' output print "Content-type: text/html\n\n"; print "Effrecipes -- List of all Ingredients\n" print "

List of All Ingredients

\n\n" # Show complete list of records print "Select a record to view:\n" print "\n" inglist = effrecipes.ingredient_list(None, conn) for record in inglist: print "" print '' print "\n" print "
', record.Name, '

" print 'Create new record
' print 'Back to front page.
' # Cleanup and exit print "" conn.close()