author | fabien@tzone.org |
Wed, 31 Dec 2008 01:53:22 -0500 | |
changeset 73 | c078d8a04d76 |
parent 67 | 652ff41518f3 |
child 74 | 6784c4350b41 |
permissions | -rwxr-xr-x |
0 | 1 |
#!/usr/bin/python |
2 |
||
3 |
import sys |
|
4 |
import cgi |
|
5 |
import my_db |
|
47
2781ac85b807
[svn r1604] Implement default_view preferences, which move things around a lot.
fabien
parents:
41
diff
changeset
|
6 |
from os import environ |
65
b975a3d7606a
Partial submission, to include tests.
Fabien Ninoles <fabien@tzone.org>
parents:
58
diff
changeset
|
7 |
from actions import actions |
67
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
8 |
from config import CONFIG |
0 | 9 |
|
67
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
10 |
def main(): |
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
11 |
sys.stderr = sys.stdout |
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
12 |
print "Content-type: text/html; charset=iso-8859-1;" |
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
13 |
|
0 | 14 |
form = cgi.FieldStorage() |
67
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
15 |
debug = form.has_key('debug') |
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
16 |
if debug: |
57 | 17 |
sys.stderr = sys.stdout |
18 |
print "<pre>" |
|
65
b975a3d7606a
Partial submission, to include tests.
Fabien Ninoles <fabien@tzone.org>
parents:
58
diff
changeset
|
19 |
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
|
20 |
prefs = db.get_preferences() |
57 | 21 |
if form.has_key('action'): |
22 |
action = form['action'].value |
|
23 |
else: |
|
24 |
action = 'default' |
|
25 |
if action in actions.keys(): |
|
26 |
actions[action](action, db, prefs, form) |
|
27 |
else: |
|
28 |
actions['default']('default', db, prefs, form) |
|
67
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
29 |
if debug: |
652ff41518f3
Update index.py and config to use the right information.
fabien@tzone.org
parents:
65
diff
changeset
|
30 |
print "</pre>" |