Brandon's Blog

7/2/2012

Gaining Clarity

In between lots of family engagements and a heightened battle with fussiness, Clarity is taking shape.  It’s a stunningly simple read-only front-end (I’ve elected to forgo commenting), a one-function backend (import and catalog incoming pictures), and a lightweight hook to Efendi so I can get linked thumbnail pictures onto the front page of the blog.

My “stack” is Apache for the basic serving, Python for teh codez, Werkzeug (a Python library) to handle the interface between Python and Apache, and a file-based “database” which is really just an encoded list of strings in Python.

Werkzeug is my kind of tool.  What it lacks in detailed documentation is compensated for by its extreme libertarianism.  You pretty much pull in hunks of Werkzeug as you want them, and write your own or omit if you don’t.  Turns out the glue that stuck Werkzeug to Efendi could really have been reused in this app (and probably in Brightlamp as well), so there’s a bit of copy-paste coding going on as I rig up the basics of my app.  In many ways, Clarity is running on a very thin skeleton of what makes Efendi work.

The productivity of Python makes the coding part of this exercise, especially with Efendi providing what might be considered a silver-standard boilerplate, almost trivial.  My work pattern has been mostly thinking, then more thinking, then reversing previous thoughts, then a little blast of coding and copy-paste that implements an entire section of the app.

The front-end is essentially complete (did the HTML side over breaks at work), and the data model is basically there.  This pretty much leaves the photo-importing backend as the major work to do.  That’s not too bad, but it’s the major work of the project.  I’ve just paper-and-pencil’ed it to only consume a single webpage, so I’m excited to code it in tonight, time permitting.  This may mean I could have a working version by today or tomorrow, if I’m lucky!