# HG changeset patch
# User fabien
# Date 1064438392 14400
# Node ID 7357230539d2d8833e20ae14e5dbdceb8aff67c1
# Parent 800be3836f3b7a4d8939eca585b88c1f1402b106
[svn r1547] Add count to keywords.
diff -r 800be3836f3b -r 7357230539d2 TODO
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/TODO Wed Sep 24 17:19:52 2003 -0400
@@ -0,0 +1,10 @@
+* Used SQL sequence instead of the db_sequence table.
+* Add delete bookmark.
+* Add edit/delete/merge keyword.
+* Add CSS.
+* Add better navigational means.
+* Add limit query page or move keywords up.
+* Add Search capabilities.
+* Add default (dynamic?) tree expansion.
+* Add multiuser support.
+* Add XBel Import/Export.
diff -r 800be3836f3b -r 7357230539d2 add_result.py
--- a/add_result.py Wed Sep 24 16:44:09 2003 -0400
+++ b/add_result.py Wed Sep 24 17:19:52 2003 -0400
@@ -59,7 +59,7 @@
bk = get_bk_from_form(form)
kw = get_kw_from_form(form)
newkw = get_new_kw_from_form(form)
- (ids, kws) = map(list,apply(zip, db.get_all_keywords()))
+ (ids, kws, cnt) = map(list,apply(zip, db.get_all_keywords()))
for elem in newkw:
if elem in kws:
kw.append(ids[kws.index(elem)])
diff -r 800be3836f3b -r 7357230539d2 index.py
--- a/index.py Wed Sep 24 16:44:09 2003 -0400
+++ b/index.py Wed Sep 24 17:19:52 2003 -0400
@@ -31,6 +31,7 @@
chk = key[0] in sel
res.append({'id':key[0],
'keyword': key[1],
+ 'count' : key[2],
'checked' : chk})
res.sort(lambda l,r: cmp(l["keyword"],r["keyword"]))
return res
@@ -38,18 +39,21 @@
def get_curl():
return urljoin( 'http://' + environ["HTTP_HOST"] + environ["REQUEST_URI"], 'add.py')
-def main(bk, kw, curl):
+def main(bk, kw, curl, total):
tmpl = TemplateManager().prepare("index.tmpl")
tproc = TemplateProcessor()
tproc.set("Bookmarks", bk)
tproc.set("Keywords", kw)
tproc.set("curl", curl)
+ tproc.set("total", total)
print tproc.process(tmpl)
if (__name__ == "__main__"):
form = cgi.FieldStorage()
db = my_db.connect()
- keywords = db.get_all_keywords()[1:]
+ keywords = db.get_all_keywords()
+ total = keywords[0][2]
+ keywords = keywords[1:]
selection = get_selection(form)
if selection[0] == 0:
exc = map(lambda e: int(e[0]), keywords)
@@ -61,4 +65,4 @@
bookmarks = db.get_bookmarks(map(lambda x: x[0], bookmarks))
bookmarks = map(lambda bk: bk.dict(), bookmarks)
curl = get_curl();
- main(bookmarks, keywords, curl)
+ main(bookmarks, keywords, curl, total)
diff -r 800be3836f3b -r 7357230539d2 index.tmpl
--- a/index.tmpl Wed Sep 24 16:44:09 2003 -0400
+++ b/index.tmpl Wed Sep 24 17:19:52 2003 -0400
@@ -10,6 +10,7 @@
href="javascript:bk1='
Total bookmarks: