diff -r 31271426f879 -r 004a32370ba5 do_edit_kw.py --- a/do_edit_kw.py Sat Dec 27 20:23:39 2008 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -#!/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 -from bkmark import Bookmark -from keywords import get_keywords -import os - -def main(action, sel_keywords, keywords, prefs): - tmpl = Template("kw_confirm.tmpl", prefs) - tmpl.set("confirm_delete", action == 'delete') - tmpl.set("confirm_merge", action == 'merge') - tmpl.set("confirm_rename", action == 'rename') - tmpl.set("action", action) - tmpl.set("Selected", sel_keywords) - tmpl.set("Keywords", keywords) - print tmpl.process() - -if (__name__ == "__main__"): - form = cgi.FieldStorage() - db = my_db.connect(os.environ["REMOTE_USER"]) - ids = get_keywords(form, 'kw') - keywords = map(lambda e: { 'id': e[0], 'keyword': e[1]}, - db.get_all_keywords()[1:]) - keywords.sort(lambda x, y: cmp(x['keyword'],y['keyword'])) - sel_keywords = filter(lambda e: e['id'] in ids, keywords) - keywords = filter(lambda e: e['id'] not in ids, keywords) - action = form['action'].value - main(action, sel_keywords, keywords, db.get_preferences()) -