15
|
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, TemplateProcessor
|
|
15 |
import my_db
|
|
16 |
import time
|
|
17 |
from bkmark import Bookmark
|
|
18 |
|
|
19 |
if (__name__ == "__main__"):
|
|
20 |
form = cgi.FieldStorage()
|
|
21 |
db = my_db.connect()
|
|
22 |
id = int(form['id'].value)
|
|
23 |
action = form['action'].value
|
|
24 |
kwname = db.get_keyword(id)
|
|
25 |
name = form['name'].value
|
|
26 |
merge = int(form['keywords'].value)
|
|
27 |
mergename = db.get_keyword(merge)
|
|
28 |
tmpl = TemplateManager().prepare("kw_confirm.tmpl")
|
|
29 |
tproc = TemplateProcessor()
|
|
30 |
tproc.set("confirm_delete", action == 'delete')
|
|
31 |
tproc.set("confirm_merge", action == 'merge')
|
|
32 |
tproc.set("confirm_update", action == 'update')
|
|
33 |
tproc.set("action", action)
|
|
34 |
tproc.set("id", id)
|
|
35 |
tproc.set("name", kwname)
|
|
36 |
tproc.set("newname", name)
|
|
37 |
tproc.set("mergeid", merge)
|
|
38 |
tproc.set("mergename", mergename)
|
|
39 |
print tproc.process(tmpl)
|
|
40 |
|