diff -r 6b31934e5b2e -r 31271426f879 index.py --- a/index.py Mon Aug 23 23:31:38 2004 -0400 +++ b/index.py Sat Dec 27 20:23:39 2008 -0500 @@ -10,14 +10,25 @@ print "Content-type: text/html; charset=iso-8859-1;" print -# import cgitb; cgitb.enable() +import cgitb; cgitb.enable() import cgi import my_db from os import environ -from webutils import load_index +from actions import actions; if (__name__ == "__main__"): form = cgi.FieldStorage() + if form.has_key('debug'): + sys.stderr = sys.stdout + print "
"
db = my_db.connect(environ["REMOTE_USER"])
prefs = db.get_preferences()
- load_index(db, prefs, form)
+ if form.has_key('action'):
+ action = form['action'].value
+ else:
+ action = 'default'
+ if action in actions.keys():
+ actions[action](action, db, prefs, form)
+ else:
+ actions['default']('default', db, prefs, form)
+ print ""