I was doing a few adjustments to Iridium, specially on the image thumbnail generation, which is done via PIL, which has its share of problems.
First is the problem with "corrupted" image files, it could be either truthfully corrupted files or a file that hasn't been completely uploaded (very unlikely), PIL has some funny behaviors with those files and verifying the file is not simple, see django bug #3848 patch on this.
PIL usually trows exceptions, however, given that the function that handles file upload and thumbnailing is called Async (ajax) django won't trow the usual error page, debugging with breakpoints usually pin points the offending line, but you will not get any messages or exceptions (they are lost), at least with WingIDE, which makes debugging this kind of code with an IDE as useful as a bunch of print statements.
Once this was done I changed a few javascript lines to verify that the file has a thumbnail, the whole thing started misbehaving from there, steeping trough the javascript code with firebug revealed interesting behaviors, firefox was doing whatever it wanted with my code, including traversing trough wrong code paths (not respecting ifs), which was strange as it was working a few minutes ago, what was the problem? it was only a few lines, no typos, the only difference between last successful run was... Firebug, which I had tested before and find it useful, I had installed the new version (1.4) just a few minutes ago...
In the end I disabled firebug and reloaded, everything worked as it should be, looking at the firebug page there is a bunch of negative comments on the quality of this version, now I see why, either the thing didn't installed right, a bug or plainly this version sucks.
domingo, 26 de julio de 2009
viernes, 24 de julio de 2009
Iridium
Not so long ago I started working on a django based application to manage software projects, Iridium, this as an internal project for my company, I looked to many fine alternatives but I wanted to reuse our expertise on Python and focus on django, at the time I was not convinced with the available options and started my own project.
Today I decided to release Iridium as open source, under a very permisive 3 clause BSD license.
Iridium is lightweight and simple, when I started writing it I didn't have much experience with django, coming from TurboGears I created a few utilities to be feel at home (like decorators for templates), thus the code may be wildly diferent from your usual django app.
Fortunately I have received a very positive response from the comunity where the project is hosted (github):
http://github.com/clsdaniel/iridium
Today I decided to release Iridium as open source, under a very permisive 3 clause BSD license.
Iridium is lightweight and simple, when I started writing it I didn't have much experience with django, coming from TurboGears I created a few utilities to be feel at home (like decorators for templates), thus the code may be wildly diferent from your usual django app.
Fortunately I have received a very positive response from the comunity where the project is hosted (github):
http://github.com/clsdaniel/iridium
sábado, 11 de julio de 2009
pyvcs
A few days ago I found this project, pyvcs, which aims to create a simple API for accessing useful data from many different VCS (such as git, hg, subversion, etc), just enough to create a repository browser.
Just exactly what I was looking for!, it supported Git and Mercurial, browsing the source it seemed simple and elegant, and thus I began coding a subversion backend, I already coded a browser for subversion repositories using python (for the now defunct tecforge) and zope, but that was with the low level svn python binding, this time I used pysvn (which seems to be the official binding now), it was a bit of guesswork, the documentation laked in details but was workable, in the end my work got merged with mainline.
I have been migrating my project from custom code to pyvcs and things are a lot easier now, also pyvcs is moving fast, it now supports git, hg, bzr and svn (all major open source vcs).
PyVCS Home:
http://github.com/alex/pyvcs
Just exactly what I was looking for!, it supported Git and Mercurial, browsing the source it seemed simple and elegant, and thus I began coding a subversion backend, I already coded a browser for subversion repositories using python (for the now defunct tecforge) and zope, but that was with the low level svn python binding, this time I used pysvn (which seems to be the official binding now), it was a bit of guesswork, the documentation laked in details but was workable, in the end my work got merged with mainline.
I have been migrating my project from custom code to pyvcs and things are a lot easier now, also pyvcs is moving fast, it now supports git, hg, bzr and svn (all major open source vcs).
PyVCS Home:
http://github.com/alex/pyvcs
Suscribirse a:
Entradas (Atom)