equal
deleted
inserted
replaced
1 #!/usr/bin/python |
|
2 |
|
3 import sys |
|
4 import traceback |
|
5 if (__name__ == '__main__'): |
|
6 sys.path.insert(0, "/home/fabien/lib/python") |
|
7 sys.path.insert(0, "./lib") |
|
8 sys.stderr = sys.stdout |
|
9 |
|
10 print "Content-type: text/html; charset=iso-8859-1;" |
|
11 print |
|
12 |
|
13 # import cgitb; cgitb.enable() |
|
14 import cgi |
|
15 import my_db |
|
16 |
|
17 from local_config import CONFIG |
|
18 from os import environ |
|
19 from actions import actions |
|
20 |
|
21 if (__name__ == "__main__"): |
|
22 form = cgi.FieldStorage() |
|
23 if form.has_key('debug'): |
|
24 sys.stderr = sys.stdout |
|
25 print "<pre>" |
|
26 db = my_db.connect(CONFIG, environ["REMOTE_USER"]) |
|
27 prefs = db.get_preferences() |
|
28 if form.has_key('action'): |
|
29 action = form['action'].value |
|
30 else: |
|
31 action = 'default' |
|
32 if action in actions.keys(): |
|
33 actions[action](action, db, prefs, form) |
|
34 else: |
|
35 actions['default']('default', db, prefs, form) |
|
36 print "</pre>" |
|