lib/dynamic.py
branchxbelweb
changeset 51 7015d65beb3d
parent 47 2781ac85b807
child 58 004a32370ba5
equal deleted inserted replaced
50:5275135955c0 51:7015d65beb3d
     1 #!/usr/bin/python
     1 #!/usr/bin/python
     2 
     2 
     3 from keywords import get_keywords, sort_keywords
     3 from keywords import get_keywords, sort_keywords, set_selection
     4 from templates import Template
     4 from templates import Template
     5 
     5 
     6 def process_index(bk, kw, pref):
     6 def process_index(bk, kw, pref):
     7     tmpl = Template("dynamic.tmpl", pref)
     7     tmpl = Template("dynamic.tmpl", pref)
     8     bk.sort(lambda x,y: cmp(x['name'],y['name']))
     8     bk.sort(lambda x,y: cmp(x['name'],y['name']))
     9     tmpl.set("Bookmarks", bk)
     9     tmpl.set("Bookmarks", bk)
    10     kw = sort_keywords(kw, pref)
    10     kw = sort_keywords(kw, pref)
    11     tmpl.set("Keywords", kw)
    11     tmpl.set("Keywords", kw)
    12     tmpl.set("curl", get_curl())
       
    13     tmpl.set("total", len(bk))
    12     tmpl.set("total", len(bk))
    14     print tmpl.process()
    13     print tmpl.process()
    15 
    14 
    16 def do_dynamic(db, prefs, form = []):
    15 def do_dynamic(db, prefs, form = []):
    17     if form:
    16     if form: