equal
deleted
inserted
replaced
|
1 #!/usr/bin/python |
|
2 |
|
3 import sys |
|
4 import traceback |
|
5 sys.path.insert(0, "/home/fabien/lib/python") |
|
6 sys.path.insert(0, "./lib") |
|
7 sys.stderr = sys.stdout |
|
8 |
|
9 print "Content-type: text/html; charset=iso-8859-1;" |
|
10 print |
|
11 |
|
12 # import cgitb; cgitb.enable() |
|
13 import cgi |
|
14 from htmltmpl import TemplateManager |
|
15 from webutils import get_template_processor |
|
16 import my_db |
|
17 import os |
|
18 |
|
19 def main(prefs): |
|
20 tmpl = TemplateManager().prepare("prefs.tmpl") |
|
21 tproc = get_template_processor(prefs) |
|
22 fields = [] |
|
23 for field in ['keyword', 'count']: |
|
24 fields.append({'field': field, |
|
25 'selected' : prefs['keywords_sort'] == field }) |
|
26 tproc.set('Sortfields', fields) |
|
27 print tproc.process(tmpl) |
|
28 |
|
29 if (__name__ == "__main__"): |
|
30 db = my_db.connect(os.environ["REMOTE_USER"]) |
|
31 main(db.get_preferences()) |