About five years ago I began working on what would/should have become
the re-write of packages.gentoo.org,
dubbed "P2". Back then the best non-Zope web framework for Python was agueably
Quixote. This is the framework I used to write P2. Well, a lot has happened
since then. I resigned as a Gentoo developer. Quixote has pretty much fallen
off the radar, and Django is at the head of the Python web frameworks. I've
always wanted to port P2 to a more modern platform, but just never got around
to it. Well over the weekend I stared playing more with Django and began creating
an ORM model for ebuild/database gateway that I used for P2. It wasn't too
long before I had Django models, and an interface script that could crawl through
the portage tree and create and destroy Category, Package, and Release models, as
well as the custom "Metagory" class that I created for P2. Most of crawl code
was ported directly from P2. I created a new Ebuild class that represents (a
subset of) an ebuild, and the crawl code does the CRUD on the database using the
Django ORM. It seems even faster than the manual SQL code I wrote 5 years ago and
it's all awesome deliciously sweet.
Well, tonight I thought I'd work on the views. This actually required a little more work, as the Django template engine is very different from the Quixote PTL engine. A bit of analyzing, copying, cutting and pasting and voila!
The first pic is whata typical P2 page looks like (yes, I still have the code running in a virtual machine).
The second picture is what I've done tonight with Django. As youcan see they're pretty similiar. I have a little more work to do but it's mostlydone. Next I need to add the right menues, some more views and the Search interface. I never did complete the search interface for P2. This timeI'm considering using Xapian.
So why am I doing this, especially since I'm not a Gentoo dev and not workingon packages.gentoo.org anymore? Well, firstly I think it's fun and interesting, whichis the primary reason I got involved with writing it in 2003. Also, I thinkthe current online packages database is lacking and pretty much unusable soI'm doing this to scratch an itch. Perhaps I'll release the software so otherscan run it to as an alternative to the official site. Whatever the case may beI'm just having fun working on something I love.