A day with Nevow and LivePage (Good news is that the SVN version fixes the bug...)
Written by
on
in
Snaking.
I discovered a bug in the released Nevow that I am using for the trigger configuration pages in Cinemon. The bug is fairly simple, when a user returns to a page (loading it from their browser's cache), the server has not rendered the page for this loading. Because Nevow constructs the client connection object during rendering, this meant that a user returning to a page wouldn't have any of the callbacks required to make the page "live" registered.
Well, as you might expect, the easiest way to solve that problem is just to disable caching of the page, and that's exactly what Nevow has done in SVN. Great. Except that they've also deprecated the "handler" objects which allow you to construct dynamically-generated live-pages.
Spent a bit of time reviewing the two mechanisms that replace the handler objects. Neither is appropriate for doing nested tree-editing controls. One is defined as methods on the page object, the other is single-use callbacks. When you construct a live sub-form you don't want to have to inject handlers into the main page, nor do you want to have the form active solely for the first event that it generates.
So, I created (and posted to the twisted-web list) a mechanism that gives the bulk of the functionality of the handler objects (at least, everything we were using). I also reworked some of the mechanisms inside the LivePage object set so that it's easier to work with LivePages (in particular, you can access the current ClientHandle object in any rendering method).
The amount of boilerplate required to do the overriding was somewhat off-putting. LivePage uses a set of contained objects to provide its functionality. When you want to override a low-level object like a ClientConnection you wind up having to subclass 4 or 5 classes just to override their declarations of which lower-level class is to be used for constructing the contained objects.
I also spent around an hour this morning wrestling with the balky phone for Cinemon. I think I've figured out all the kinks but wow, it is a truly non-intuitive user interface in almost every way. The voicemail link doesn't even suggest that you can get to your messages, it just launches into the please-leave-a-message greeting (you have to press # during that to get to your messages). The address book is just baroque. Oh well, I'll likely only use it for answering incoming calls anyway.
Pingbacks
Pingbacks are closed.
Comments
Comments are closed.