do_edit_kw.py
author fabien
Fri, 26 Sep 2003 11:03:02 -0400
branchxbelweb
changeset 16 07adce9ccccb
parent 15 574631f841c3
child 21 345ee7421989
permissions -rwxr-xr-x
[svn r1550] Retrait de fonctions inutiles (maintenant dans kw_result.py)

#!/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 htmltmpl import TemplateManager, TemplateProcessor
import my_db
import time
from bkmark import Bookmark

if (__name__ == "__main__"):
    form = cgi.FieldStorage()
    db = my_db.connect()
    id = int(form['id'].value)
    action = form['action'].value
    kwname = db.get_keyword(id)
    name = form['name'].value
    merge = int(form['keywords'].value)
    mergename = db.get_keyword(merge)
    tmpl = TemplateManager().prepare("kw_confirm.tmpl")
    tproc = TemplateProcessor()
    tproc.set("confirm_delete", action == 'delete')
    tproc.set("confirm_merge", action == 'merge')
    tproc.set("confirm_update", action == 'update')
    tproc.set("action", action)
    tproc.set("id", id)
    tproc.set("name", kwname)
    tproc.set("newname", name)
    tproc.set("mergeid", merge)
    tproc.set("mergename", mergename)
    print tproc.process(tmpl)