I've been working on something for my PyCon talk for far too long now. I started in Nevow + Athena, which is a technology I'm moderately familiar with, having written Cinemon using it (though that was years ago now). I got a nice single-person implementation done with Athena and then started looking into how to get Google/Yahoo/MSN single-sign-on integrated while getting some sort of persistence mechanism integrated.
I got stalled somewhere in there as I searched for the one-true-Twisted-web-way. Stalling happens sometimes when my mind is saying "hey, this is way too much work for too little forward motion". I probably burned half a dozen hours over almost a week pouring through (often broken) docs and code for Nevow, Athena, Guard, Twisted Web, Twisted Web2 and AsyncDB and came out mind-numbed and needing a break.
So, I spent time playing with twisted-cometd (broken, no longer even mentioned in release notes for the package), then I started playing with Tornado-in-Twisted... oh, OpenID auth is built in... But doesn't seem to work in the Twisted version... so I decided to play with the non-Twisted version this evening. A bit of impetus there came from the fact that a friend had offered to help with the project if we used Tornado
.
That was easy. I did a bit of work to get a login-with-LaunchPad (OpenID) button working (still unsatisfied with that, but just because I don't have a registration with them, so don't get back anything useful wrt metadata). I set up a page to let the user choose from multiple identity providers for login. I refactored the long-polling javascript client code from a demo to be more "me-ish". Then I implemented a CouchDB client to provide storage.
CouchDB is actually new for me (one of the reasons I decided to play with it this evening). I've seen many talks about it, watched people use it, read articles about the implementation, and generally understood it, but I'd never actually done anything with it. So far, it seems easy. I'm effectively using raw (async) HTTP queries to get/put/delete and query and even with that it's relatively straightforward.
Anyway, at this point I can actually start working on the tool I want to build again. For now I'm going to go forward with the Tornado implementation and move my Athena UI prototype (which is 90% jquery, css and html) over to it. With authentication and storage done (though I don't have MSN login, I'm likely going to punt on that) I can just finish the remainder of the UI coding and be done with it. Maybe I'll look back at Twisted-Tornado if I find myself needing e.g. IRC bot integration (possible, but not critically important). I doubt I'll go back to the Athena version at this point, not for any reason other than that I've got a working shell already.
Having now done some (relatively low-level) network coding (the CouchDB client) using Tornado's async model, I strongly prefer the Twisted Deferred, but the coherent documentation and API and built-in support for OpenID/OAuth means I have come un-stuck and can move forward again, and if that means using slightly more awkward callbacks, then so be it.


Comments
2010-08-31 12:04
That template db idea is prett y neat. I have to say it's get ting pretty annoying downloadi ng database backups and [...]
2010-08-23 20:57
Yeah, in a similar boat with t he code I write... upshot, I'v e got some pretty good compat code in snakeoil, just w [...]
2010-08-22 08:40
Yeah, that's what I started do ing (the function to convert t o bytes), as I support down to 2.4. Thing is this is [...]
2010-08-22 06:28
Your blog aparently likes does n't handle the less than char (<) conversion all that wel l.. everything following [...]
2010-08-22 06:24
The annoying thing about suppo rting both py2k and py3k is th at you wind up having to get r ather explicit about you [...]
2010-08-16 00:48
The measure of a man, I have a lways thought, was - that he l oved. And was loved.
2010-08-15 21:28
Hmm, hadn't realized that was what dpush was for. I guess I 'll have to make the trunk a b ranch rather than a chec [...]
2010-08-15 20:43
For what it's worth, newer ver sions of bzr-svn will not remo ve existing revisions from you r mainline unless you ex [...]
2010-08-15 20:40
bzr-svn supports not inserting any unusual revision properti es, it just means that pushing your bzr revisions into [...]
2010-08-15 18:21
Hmm, maybe I missed something there. Do you mean merge supp ort as in being able to pull f rom N branches into your [...]
2010-08-15 17:45
Lack of merge support kills th e main benefit of bzr-svn over just using svk I'd argue. Personally, I'm *extreme [...]
2010-08-15 11:46
You might want to check out hg subversion
2010-07-25 14:02
> and would have no Trac integ ration The trac-bzr plugin[ 1] seems to provide good integ ration between bzr and t [...]
2010-07-13 21:47
I've always been fascinated wi th the Asterisk AMI interface. So much so that I married tha t fascination with the [...]
2010-07-03 21:32
Yes, only references in dicti onaries are replaced, so hold ing references in lists, tuple s, etceteras keeps them alive.