lib/xbelweb.py
author fabien@tzone.org
Tue, 30 Dec 2008 23:32:33 -0500
changeset 67 652ff41518f3
parent 65 index.py@b975a3d7606a
child 74 6784c4350b41
permissions -rwxr-xr-x
Update index.py and config to use the right information.

#!/usr/bin/python

import sys
import cgi
import my_db
from os import environ
from actions import actions
from config import CONFIG

def main():
    sys.stderr = sys.stdout
    print "Content-type: text/html; charset=iso-8859-1;"
    print
    form = cgi.FieldStorage()
    debug = form.has_key('debug')
    if debug:
	sys.stderr = sys.stdout
	print "<pre>"
    db = my_db.connect(CONFIG, environ["REMOTE_USER"])
    prefs = db.get_preferences()
    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)
    if debug:
    	print "</pre>"