pyRest part 3: Routing and responsibilities

In part 2, I hooked up the API to CherryPy in a very crude fashion, and this time we’ll look at how we can add handlers for resources in a less clumsy way. I decided to keep handlers on one ’level’ only – that is, /sketch/parrot and /sketch...

pyRest part 2: Hooking the API

In part 1, a very unexciting base CherryPy implementation was all we had, but now it’s time to hook up something real! Instead of creating a mock API to work against as example code, I’ve decided to use hgapi to access the pyrest repo itself as example...

Sending non-valid names as arguments

I got a feature request on hgapi the other day, pointing out that it was not possible to filter the Mercurial log using the API, since there is no dedicated way to do it and the fallback method – sending keyword arguments that will be passed to the command line...

See me on an island!

I’ve really neglected to update the blog lately, but that’s at least in part because I’ve been busy doing preparations for talks – so you could see me instead of read my blog! I’ll be speaking both at PyCon UK and PyCon Ireland, so if...

You should send a presentation proposal to PyCon

Next year, in March, I will be at PyCon. It will be the third time I attend PyCon – ever since I attended my first, not going has not really been an option. There are lots of good things about PyCon – meeting interesting people, seeing San Francisco,...

Using the AST to hack constants into Python

During EuroPython 2012, after my training and talks, I really needed to do some coding, so I started hacking on a ’practical’ application of the AST – making (some) constants faster than local variables, instead of slower by inlining them on import....

EuroPython impressions

I had a blast at Europython – I made new friends, went to a couple of talks that gave me some ideas for the future, and my own talks seemed to go down well. All in all, the EP2012 organization was great, the food was way beyond ’normal’ conference...

You deserve practice

I enjoyed The Clean Coder by Uncle Bob, and would recommend it to any serious developer. I agree with almost everything in it, but there is one jarring exception – I disagree strongly with his view that because it’s your own responsibility to practice, you...

Version 1.2.0 of hgapi released

hgapi is a pure-Python API for Mercurial, which uses the command-line interface for maximum compatibility. It is tested for Python 2.7 and 3.2. Version 1.2.0 fixes a few bugs, and allows iterating over a repository as well as using slices ( i.e....