9 print "Content-type: text/html; charset=iso-8859-1;" |
9 print "Content-type: text/html; charset=iso-8859-1;" |
10 print |
10 print |
11 |
11 |
12 # import cgitb; cgitb.enable() |
12 # import cgitb; cgitb.enable() |
13 import cgi |
13 import cgi |
14 from htmltmpl import TemplateManager |
14 from templates import Template |
15 from webutils import get_template_processor |
|
16 import my_db |
15 import my_db |
17 from bkmark import Bookmark |
16 from bkmark import Bookmark |
18 from webutils import get_keywords |
17 from keywords import get_keywords |
19 import os |
18 import os |
20 |
19 |
21 def main(action, sel_keywords, keywords, prefs): |
20 def main(action, sel_keywords, keywords, prefs): |
22 tmpl = TemplateManager().prepare("kw_confirm.tmpl") |
21 tmpl = Template("kw_confirm.tmpl", prefs) |
23 tproc = get_template_processor(prefs) |
22 tmpl.set("pagetitle", os.environ["REMOTE_USER"]+"'s XBELWeb Confirmation") |
24 tproc.set("pagetitle", os.environ["REMOTE_USER"]+"'s XBELWeb Confirmation") |
23 tmpl.set("confirm_delete", action == 'delete') |
25 tproc.set("confirm_delete", action == 'delete') |
24 tmpl.set("confirm_merge", action == 'merge') |
26 tproc.set("confirm_merge", action == 'merge') |
25 tmpl.set("confirm_rename", action == 'rename') |
27 tproc.set("confirm_rename", action == 'rename') |
26 tmpl.set("action", action) |
28 tproc.set("action", action) |
27 tmpl.set("Selected", sel_keywords) |
29 tproc.set("Selected", sel_keywords) |
28 tmpl.set("Keywords", keywords) |
30 tproc.set("Keywords", keywords) |
29 print tmpl.process() |
31 print tproc.process(tmpl) |
|
32 |
30 |
33 if (__name__ == "__main__"): |
31 if (__name__ == "__main__"): |
34 form = cgi.FieldStorage() |
32 form = cgi.FieldStorage() |
35 db = my_db.connect(os.environ["REMOTE_USER"]) |
33 db = my_db.connect(os.environ["REMOTE_USER"]) |
36 ids = get_keywords(form, 'kw') |
34 ids = get_keywords(form, 'kw') |