author | fabien@tzone.org |
Tue, 30 Dec 2008 23:16:05 -0500 | |
changeset 66 | a0aa025ee6a2 |
parent 65 | b975a3d7606a |
permissions | -rwxr-xr-x |
0 | 1 |
#!/usr/bin/python |
2 |
||
3 |
import sys |
|
4 |
import traceback |
|
15 | 5 |
if (__name__ == '__main__'): |
6 |
sys.path.insert(0, "/home/fabien/lib/python") |
|
7 |
sys.path.insert(0, "./lib") |
|
8 |
sys.stderr = sys.stdout |
|
0 | 9 |
|
15 | 10 |
print "Content-type: text/html; charset=iso-8859-1;" |
11 |
||
0 | 12 |
|
58
004a32370ba5
Correct some bugs and make keywords edition with the new action
fabien@tzone.org
parents:
57
diff
changeset
|
13 |
# import cgitb; cgitb.enable() |
0 | 14 |
import cgi |
15 |
import my_db |
|
65
b975a3d7606a
Partial submission, to include tests.
Fabien Ninoles <fabien@tzone.org>
parents:
58
diff
changeset
|
16 |
|
b975a3d7606a
Partial submission, to include tests.
Fabien Ninoles <fabien@tzone.org>
parents:
58
diff
changeset
|
17 |
from local_config import CONFIG |
47
2781ac85b807
[svn r1604] Implement default_view preferences, which move things around a lot.
fabien
parents:
41
diff
changeset
|
18 |
from os import environ |
65
b975a3d7606a
Partial submission, to include tests.
Fabien Ninoles <fabien@tzone.org>
parents:
58
diff
changeset
|
19 |
from actions import actions |
0 | 20 |
|
21 |
if (__name__ == "__main__"): |
|
22 |
form = cgi.FieldStorage() |
|
57 | 23 |
if form.has_key('debug'): |
24 |
sys.stderr = sys.stdout |
|
25 |
print "<pre>" |
|
65
b975a3d7606a
Partial submission, to include tests.
Fabien Ninoles <fabien@tzone.org>
parents:
58
diff
changeset
|
26 |
db = my_db.connect(CONFIG, environ["REMOTE_USER"]) |
47
2781ac85b807
[svn r1604] Implement default_view preferences, which move things around a lot.
fabien
parents:
41
diff
changeset
|
27 |
prefs = db.get_preferences() |
57 | 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>" |