[svn r1610] Lots of "small" bugs corrected.
#!/usr/bin/python
import sys
import traceback
sys.path.insert(0, "/home/fabien/lib/python")
sys.path.insert(0, "./lib")
sys.stderr = sys.stdout
print "Content-type: text/html; charset=iso-8859-1;"
print
# import cgitb; cgitb.enable()
import cgi
from templates import Template
import my_db
import time
import os
def main(keywords, prefs):
tmpl = Template("edit_kw.tmpl", prefs)
tmpl.set('Keywords', keywords)
print tmpl.process()
if (__name__ == "__main__"):
form = cgi.FieldStorage()
db = my_db.connect(os.environ["REMOTE_USER"])
kw = db.get_all_keywords()[1:]
kw = map(lambda elem: {
'id' : elem[0],
'keyword' : elem[1] }, kw)
kw.sort(lambda l,r: cmp(l['keyword'],r['keyword']))
main(kw, db.get_preferences())