Basura

Sam Ruby introduces Basura:

P.S. That basura link above?  It is a bzr repository... check it out!

sgala $ bzr checkout http://intertwingly.net/code/basura/
sgala $ cd basura
sgala $ python server.py 
Serving HTTP on 0.0.0.0 port 8080 ...

done!

Then I tried to test it with my standard get small json shell idiom:

sgala $ GET http://localhost:8080/
{'basura': 'Welcome', 'version': '0.0.1'}

Insidious bug up there, as simplejson plus my standard get small json python idiom shows:

sgala $ python -c """
import simplejson
import urllib
for key,value in simplejson.load(urllib.urlopen('http://localhost:8080/')).items():
  print key,'=',value
"""
Traceback (most recent call last):
(...)

It happens that json enforces ‘"’ as string separator, unlike python. The result should be {"basura": "Welcome", "version": "0.0.1"}, note that json is unforgiving about quotes. A small patch later (which I found is already there, courtesy Christopher Lenz) and I’m going.

sgala $ python -c """
import simplejson
import urllib
for key,value in simplejson.load(urllib.urlopen('http://localhost:8080/')).items():
  print key,'=',value
"""
basura = Welcome
version = 0.0.1

This first experiment was easy, I’m starting to like this approach to handle document DBs. I tested CouchDB recently, I got Basura running very fast. I’m going to need it possibly to prototype a REST Bibliographic repository, full of big textual objects and text only searches, soon.

Note: bzr is intelligent enough to suck my change into Christopher’s (they were bit for bit identical), even if the revision came together with a bunch of changes by Sam. Good for bzr! More evidence for my poll on SCM. Linus is probably right in the conference on git and distributed SCM when he says that the key SCM feature is fast branching and merging, this is where expensive attention is spent. (Transcript)

Add your comment












Nav Bar