lib/xbelweb.py
changeset 67 652ff41518f3
parent 65 b975a3d7606a
child 74 6784c4350b41
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/xbelweb.py	Tue Dec 30 23:32:33 2008 -0500
@@ -0,0 +1,30 @@
+#!/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>"