pyRest part 4: Separating the parts

(part 1, part 2, part 3)

I've now split the code into separate parts - now only has generic functionality for hooking and routing, along with a bunch of helpers to create responses with HTTP response types. In fact, it's only 35 lines of code, and that's the entire 'core' of pyRest so far.

The CherryPy integration has moved to the pyrest.integration package as - it's still pretty clumsy to use (python -m pyrest.integration.cherry/ can \_only\_ hook up the hgapi example code), and the hgapi implementation has been moved into the pyrest.examples.hg package. The CherryPy parts have not changed much beyond always expecting a /Response tuple and using it to set response status and content, but the hgapi integration now sports a post function, allowing me to commit the code just written using itself! also uses the new Response helpers to create the return values.

The code was committed using a POST request to //api/changeset?message=Comitting via pyrest/. Next, I'm planning to make the Mercurial integration useful, and/or the CherryPy integration a bit more robust.

Code is as always available at Bitbucket.

comments powered by Disqus