lib/xbelweb.py
author fabien@tzone.org
Wed, 31 Dec 2008 15:41:32 -0500
changeset 74 6784c4350b41
parent 67 652ff41518f3
permissions -rw-r--r--
Cleanup of old code, fixes some errors with folders view and make it a standard action.

#!/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>"