Python prototypes and smart search GUI
Enrico Zini
enrico at enricozini.org
Mon Aug 28 22:25:48 UTC 2006
Hello,
# apt-get install python-apt python-wxgtk2.6
$ svn co svn://svn.debian.org/debtags/python
Do it. Really. Now.
The contents are:
Debtags.py
A python module with useful code for playing with Debtags.
Think of it like a very simplified reimplementation of libtagcoll.
reverse
Reads a collection of package->tags and spits out a collection of
tag->packages. It's orders of magnitude faster of doing it with
tagcoll, which shows that my implementation of it in tagcoll is
deeply broken and needs some love.
Use: ./reverse /var/lib/debtags/package-tags
tagsByRelevance
Gets debtags data and a package list on input, and outputs the tags
sorted by how relevant they are to that subset of packages. The
last tags are the most relevant. This can be used to study the
relevance algorithm, and it's 34 lines of code.
Use: apt-cache search image editor | ./tagsByRelevance /var/lib/debtags/package-tags | tail -20
smartsearch
Reimplementation of the interactive terminal-based 'debtags
smartsearch' as is in the svn version of Debtags. It's 198 lines,
so it's a good way to see how the idea is implemented.
It also shows computation of discriminant packages (i.e. those who,
if selected either as "I want this" or as "I don't want this", weed
out the largest amount of tags)
Use: ./smartsearch /var/lib/debtags/package-tags image editor
then follow the instructions at the prompt
wxssearch
GUI prototype of a smartsearch interface. The interaction feels
quite good, at least to me.
Quirk: you may need to resize the window so that the tags on the
left don't wrap to the next line. I don't know how to easily solve
that, besides implementing from scratch a custom widget for it.
Check the help menu: it's got an introduction in the about box and
context-sensitive help. Wow! :)
Use: ./wxsearch
then input the keywords in the search box and search for
packages using the tags that appear below.
Ciao
Enrico
--
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/debtags-devel/attachments/20060828/9327b52c/attachment.pgp
More information about the Debtags-devel
mailing list